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