This commit is contained in:
jl777
2018-09-11 07:17:02 -11:00
parent 4aa9ec468f
commit 1801dc41e7

View File

@@ -320,7 +320,7 @@ cJSON *get_komodocli(char **retstrp,char *acname,char *method,char *arg0,char *a
if ( (jsonstr= filestr(&fsize,fname)) != 0 )
{
fprintf(stderr,"%s -> jsonstr.(%s)\n",cmdstr,jsonstr);
if ( (jsonstr[0] == '{' || jsonstr[0] == '[') && (retjson= cJSON_Parse(jsonstr)) == 0 )
if ( (jsonstr[0] != '{' && jsonstr[0] != '[') || (retjson= cJSON_Parse(jsonstr)) == 0 )
*retstrp = jsonstr;
else free(jsonstr);
}