1
0
mirror of https://github.com/DaveGamble/cJSON synced 2024-12-23 15:12:04 +00:00

cJSON_Utils: sort_lists: Properly split the lists

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!
This commit is contained in:
Max Bruckner 2018-12-20 18:12:23 +01:00
parent 6820448db5
commit 563d861f92

View File

@ -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. */