From 1058e3b2c0272dde74b06306b56bd039f54208a0 Mon Sep 17 00:00:00 2001 From: Krzysztof Gabis Date: Mon, 24 Nov 2014 21:04:15 +0100 Subject: [PATCH] Fixed bug in example code. --- README.md | 2 +- tests.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4711483..d014c99 100755 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ void persistence_example(void) { JSON_Value *user_data = json_parse_file("user_data.json"); char buf[256]; const char *name = NULL; - if (!user_data || !json_validate(schema, user_data) == JSONSuccess) { + if (user_data == NULL || json_validate(schema, user_data) != JSONSuccess) { puts("Enter your name:"); scanf("%s", buf); user_data = json_value_init_object(); diff --git a/tests.c b/tests.c index b00566c..fa4bce6 100644 --- a/tests.c +++ b/tests.c @@ -343,7 +343,7 @@ void persistence_example(void) { JSON_Value *user_data = json_parse_file("user_data.json"); char buf[256]; const char *name = NULL; - if (!user_data || json_validate(schema, user_data) == JSONSuccess) { + if (user_data == NULL || json_validate(schema, user_data) != JSONSuccess) { puts("Enter your name:"); scanf("%s", buf); user_data = json_value_init_object();