stylistic change: check EOF before strchr(). - json2tsv - JSON to TSV converter
HTML git clone git://git.codemadness.org/json2tsv
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit 42251415a957f095453b290a96bcf870632eb58d
DIR parent 33c1ceffbcb04f8a6970d04841175f96737942bb
HTML Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Wed, 23 Oct 2019 19:07:17 +0200
stylistic change: check EOF before strchr().
should have no functional difference, but check EOF first
Diffstat:
M json.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
---
DIR diff --git a/json.c b/json.c
@@ -289,8 +289,9 @@ escchr:
expect = EXPECT_END;
while (1) {
c = GETNEXT();
- if (!c || !strchr("0123456789eE+-.", c) ||
- c == EOF || p + 1 >= sizeof(pri)) {
+ if (c == EOF ||
+ !c || !strchr("0123456789eE+-.", c) ||
+ p + 1 >= sizeof(pri)) {
pri[p] = '\0';
cb(nodes, depth + 1, pri);
goto handlechr; /* do not read next char, handle this */