Kaynağa Gözat

MSVC: Fix warning about assignment in condition

Max Bruckner 8 yıl önce
ebeveyn
işleme
ac368e9dfb
1 değiştirilmiş dosya ile 2 ekleme ve 1 silme
  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;
     }