From 514bbeaf7fd2f005aea34257d89cc27b3b8919cf Mon Sep 17 00:00:00 2001 From: Petri Lehtinen Date: Wed, 6 May 2009 21:01:00 +0300 Subject: [PATCH] Parse an empty object correctly --- src/load.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/load.c b/src/load.c index ace963a..54d53b1 100644 --- a/src/load.c +++ b/src/load.c @@ -274,7 +274,10 @@ static json_t *json_parse_object(json_lex *lex) return NULL; json_lex_scan(lex); - while(1) { + if(lex->token == '}') + return object; + + while(lex->token) { char *key; json_t *value;