json: fix wrong func
authorOlaf Wintermann <olaf.wintermann@gmail.com>
Wed, 12 Jan 2022 18:23:13 +0000 (19:23 +0100)
committerOlaf Wintermann <olaf.wintermann@gmail.com>
Wed, 12 Jan 2022 18:23:13 +0000 (19:23 +0100)
application/json.c

index 5a5446e..ea167e5 100644 (file)
@@ -615,9 +615,9 @@ int json_reader_isnull(JSONParser *p) {
 JSONLiteralType json_reader_literal(JSONParser *p) {
     const char *l = p->reader_token.content;
     size_t token_len = p->reader_token.length;
-    if(token_len == 4 && !memcpy(l, "true", 5)) {
+    if(token_len == 4 && !memcmp(l, "true", 5)) {
         return JSON_TRUE;
-    } else if(token_len == 5 && !memcpy(l, "false", 5)) {
+    } else if(token_len == 5 && !memcmp(l, "false", 5)) {
         return JSON_FALSE;
     }
     return JSON_NULL;