Procházet zdrojové kódy

MSVC: Fix warning about assignment in condition

Max Bruckner před 8 roky
rodič
revize
ac368e9dfb
1 změnil soubory, kde provedl 2 přidání a 1 odebrání
  1. 2 1
      cJSON.c

+ 2 - 1
cJSON.c

@@ -147,7 +147,8 @@ static unsigned char* cJSON_strdup(const unsigned char* string, const internal_h
     }
 
     length = strlen((const char*)string) + sizeof("");
-    if (!(copy = (unsigned char*)hooks->allocate(length)))
+    copy = (unsigned char*)hooks->allocate(length);
+    if (copy == NULL)
     {
         return NULL;
     }