summaryrefslogtreecommitdiff
path: root/strings/json_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'strings/json_lib.c')
-rw-r--r--strings/json_lib.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/strings/json_lib.c b/strings/json_lib.c
index 7a6e0c5cbff..24c79cb9044 100644
--- a/strings/json_lib.c
+++ b/strings/json_lib.c
@@ -1407,7 +1407,7 @@ int json_find_paths_next(json_engine_t *je, json_find_paths_t *state)
if (!json_key_matches(je, &key_name))
continue;
}
- if ((uint) (cur_step - state->paths[p_c].last_step) == state->cur_depth)
+ if (cur_step == state->paths[p_c].last_step + state->cur_depth)
path_found= TRUE;
else
{
@@ -1440,7 +1440,7 @@ int json_find_paths_next(json_engine_t *je, json_find_paths_t *state)
cur_step->n_item == state->array_counters[state->cur_depth])
{
/* Array item matches. */
- if ((uint) (cur_step - state->paths[p_c].last_step) == state->cur_depth)
+ if (cur_step == state->paths[p_c].last_step + state->cur_depth)
path_found= TRUE;
else
{
@@ -1845,4 +1845,3 @@ int json_path_compare(const json_path_t *a, const json_path_t *b,
return json_path_parts_compare(a->steps+1, a->last_step,
b->steps+1, b->last_step, vt);
}
-