diff options
author | David Hows <david.hows@mongodb.com> | 2016-06-24 17:05:13 +1000 |
---|---|---|
committer | David Hows <david.hows@mongodb.com> | 2016-06-24 17:05:13 +1000 |
commit | d8fb874fc40989cb9675e56ca80b3b64e6fa2ee3 (patch) | |
tree | 6f03ed5cde97aedc762215c14d23ee5305998a2b /src/utilities/util_load_json.c | |
parent | fb1663e6fc800be97c0ddc697b6f939dc610e08e (diff) | |
parent | 1f4aaa4490a82cf947afdabbb9214ee5b1850d13 (diff) | |
download | mongodb-3.3.9.tar.gz |
Merge branch 'develop' of github.com:wiredtiger/wiredtiger into mongodb-3.4mongodb-3.3.9mongodb-3.3.10mongodb-3.0.1
Diffstat (limited to 'src/utilities/util_load_json.c')
-rw-r--r-- | src/utilities/util_load_json.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/utilities/util_load_json.c b/src/utilities/util_load_json.c index f1f6675e99c..020a4ed9ba9 100644 --- a/src/utilities/util_load_json.c +++ b/src/utilities/util_load_json.c @@ -248,7 +248,7 @@ json_data(WT_SESSION *session, keyformat = cursor->key_format; isrec = strcmp(keyformat, "r") == 0; for (nkeys = 0; *keyformat; keyformat++) - if (!isdigit(*keyformat)) + if (!__wt_isdigit((u_char)*keyformat)) nkeys++; recno = 0; @@ -427,6 +427,9 @@ json_top_level(WT_SESSION *session, JSON_INPUT_STATE *ins, uint32_t flags) flags)) != 0) goto err; config_list_free(&cl); + free(ins->kvraw); + ins->kvraw = NULL; + config_list_free(&cl); break; } else @@ -468,7 +471,7 @@ json_peek(WT_SESSION *session, JSON_INPUT_STATE *ins) if (!ins->peeking) { while (!ins->ateof) { - while (isspace(*ins->p)) + while (__wt_isspace((u_char)*ins->p)) ins->p++; if (*ins->p) break; @@ -544,15 +547,14 @@ json_skip(WT_SESSION *session, JSON_INPUT_STATE *ins, const char **matches) const char *hit; const char **match; - if (ins->kvraw != NULL) - return (1); - + WT_ASSERT((WT_SESSION_IMPL *)session, ins->kvraw == NULL); hit = NULL; while (!ins->ateof) { for (match = matches; *match != NULL; match++) if ((hit = strstr(ins->p, *match)) != NULL) goto out; - if (util_read_line(session, &ins->line, true, &ins->ateof)) { + if (util_read_line(session, &ins->line, true, &ins->ateof) + != 0) { ins->toktype = -1; return (1); } |