mirror of
https://github.com/kgabis/parson.git
synced 2025-02-05 08:55:30 +00:00
Fixed bug in example code.
This commit is contained in:
parent
f57f2d94bb
commit
1058e3b2c0
@ -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();
|
||||
|
2
tests.c
2
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();
|
||||
|
Loading…
Reference in New Issue
Block a user