Index: ext/misc/json1.c ================================================================== --- ext/misc/json1.c +++ ext/misc/json1.c @@ -647,12 +647,11 @@ u32 j; int iThis; int x; JsonNode *pNode; while( safe_isspace(pParse->zJson[i]) ){ i++; } - if( (c = pParse->zJson[i])==0 ) return 0; - if( c=='{' ){ + if( (c = pParse->zJson[i])=='{' ){ /* Parse object */ iThis = jsonParseAddNode(pParse, JSON_OBJECT, 0, 0); if( iThis<0 ) return -1; for(j=i+1;;j++){ while( safe_isspace(pParse->zJson[j]) ){ j++; } @@ -768,10 +767,12 @@ return j; }else if( c=='}' ){ return -2; /* End of {...} */ }else if( c==']' ){ return -3; /* End of [...] */ + }else if( c==0 ){ + return 0; /* End of file */ }else{ return -1; /* Syntax error */ } }