From ac368e9dfb3bc5ab23e2495fbb8234f090424b8b Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sat, 17 Jun 2017 14:33:55 +0200 Subject: [PATCH] MSVC: Fix warning about assignment in condition --- cJSON.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cJSON.c b/cJSON.c index f6ee1ad..81b9197 100644 --- a/cJSON.c +++ b/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; }