Explorar o código

Fix bug with the sort.

git-svn-id: svn://svn.code.sf.net/p/cjson/code@73 e3330c51-1366-4df0-8b21-3ccf24e3d50e
Dave Gamble %!s(int64=10) %!d(string=hai) anos
pai
achega
8004ed3115
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      cJSON_Utils.c

+ 1 - 0
cJSON_Utils.c

@@ -307,6 +307,7 @@ static cJSON *cJSONUtils_SortList(cJSON *list)
 	
 	while (ptr && ptr->next && cJSONUtils_strcasecmp(ptr->string,ptr->next->string)<0) ptr=ptr->next;	/* Test for list sorted. */
 	if (!ptr || !ptr->next) return list;	/* Leave sorted lists unmodified. */
+	ptr=list;
 
 	while (ptr) {second=second->next;ptr=ptr->next;if (ptr) ptr=ptr->next;}	/* Walk two pointers to find the middle. */
 	if (second && second->prev) second->prev->next=0;	/* Split the lists */