cjson解析判断
This commit is contained in:
1 parent
634a2cb475
commit
32a29f8517
1 file changed
+3
-2
@@ -103,7 +103,7 @@ void pasre_DAT(const char *api, const char *json_str)
|
|||||||
json_buffer=NULL;
|
json_buffer=NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(strlen(json_str)>4)
|
if(strlen(json_str)>10)
|
||||||
{
|
{
|
||||||
cjson_falg=1;
|
cjson_falg=1;
|
||||||
//判断json解析是否成功
|
//判断json解析是否成功
|
||||||
@@ -111,7 +111,8 @@ void pasre_DAT(const char *api, const char *json_str)
|
|||||||
{
|
{
|
||||||
rt_kprintf("JSON parse error :%s\n",cJSON_GetErrorPtr());
|
rt_kprintf("JSON parse error :%s\n",cJSON_GetErrorPtr());
|
||||||
cJSON_Delete(root);
|
cJSON_Delete(root);
|
||||||
// return "JSON parse error\n";
|
cJSON_Delete(dat);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user