Skip to content

Commit

Permalink
cJSON_Utils: sort_lists: Properly split the lists
Browse files Browse the repository at this point in the history
Since `prev` is not used anymore after that by the algorithm it should
have been fine anyways, still splitting it correctly in the first place
is probably a good idea.
Thanks @andysCaplin for the fix!
  • Loading branch information
FSMaxB committed Dec 20, 2018
1 parent 6820448 commit 563d861
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cJSON_Utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ static cJSON *sort_list(cJSON *list, const cJSON_bool case_sensitive)
{
/* Split the lists */
second->prev->next = NULL;
second->prev = NULL;
}

/* Recursively sort the sub-lists. */
Expand Down

0 comments on commit 563d861

Please sign in to comment.