Przeglądaj źródła

cJSONUtils_ApplyPatches: Fix not accepting arrays

This was completely broken, arrays weren't accepted.
Max Bruckner 8 lat temu
rodzic
commit
075a06f40b
1 zmienionych plików z 1 dodań i 6 usunięć
  1. 1 6
      cJSON_Utils.c

+ 1 - 6
cJSON_Utils.c

@@ -504,12 +504,7 @@ CJSON_PUBLIC(int) cJSONUtils_ApplyPatches(cJSON *object, cJSON *patches)
 {
     int err = 0;
 
-    if (patches == NULL)
-    {
-        return 1;
-    }
-
-    if (cJSON_IsArray(patches))
+    if (!cJSON_IsArray(patches))
     {
         /* malformed patches. */
         return 1;