cjson解析判断

This commit is contained in:
sc committed 2025-12-30 00:24:15 +08:00
1 parent 634a2cb475
commit 32a29f8517
1 file changed
+9 -8
+9 -8
View File
@@ -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)