From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 1/2] docparse: Replace \t with space
Date: Thu, 21 Jan 2021 14:05:37 +0100 [thread overview]
Message-ID: <YAl8ITSPUxDAZb40@pevik> (raw)
In-Reply-To: <20210121130033.20764-1-pvorel@suse.cz>
Hi,
...
> size_t size = sizeof(struct data_node_string) + strlen(string) + 1;
> struct data_node *node = malloc(size);
> + char *ix = node->string.val;
> if (!node)
> return NULL;
> @@ -61,6 +62,9 @@ static inline struct data_node *data_node_string(const char *string)
> node->type = DATA_STRING;
> strcpy(node->string.val, string);
Probably better to comment this:
/* tabs are not allowed in JSON */
> + while ((ix = strchr(ix, '\t')))
> + *ix++ = ' ';
Kind regards,
Petr
next prev parent reply other threads:[~2021-01-21 13:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-21 13:00 [LTP] [PATCH 1/2] docparse: Replace \t with space Petr Vorel
2021-01-21 13:00 ` [LTP] [PATCH 2/2] testinfo.pl: Optimize imports Petr Vorel
2021-01-28 14:53 ` Petr Vorel
2021-01-21 13:05 ` Petr Vorel [this message]
2021-01-21 14:47 ` [LTP] [PATCH 1/2] docparse: Replace \t with space Richard Palethorpe
2021-01-21 14:50 ` Cyril Hrubis
2021-01-21 15:43 ` Petr Vorel
2021-01-21 15:59 ` Richard Palethorpe
2021-01-21 16:20 ` Petr Vorel
2021-01-21 16:28 ` Cyril Hrubis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YAl8ITSPUxDAZb40@pevik \
--to=pvorel@suse.cz \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox