cJSON icon indicating copy to clipboard operation
cJSON copied to clipboard

may i know why this library don't have cJSON_SetStrValue define?

Open pppaulpeter opened this issue 4 years ago • 3 comments

Hi,

anybody have meet this issue before? this funtion(cJSON_SetStrValue) is replaced by someone else?

(base) ubuntu@ubuntu-XPS-8930:~/Downloads/HIVIEW/fw/cjson/test$ nm /usr/local/lib/libcjson.so |grep cJSON_SetStrValue (base) ubuntu@ubuntu-XPS-8930:~/Downloads/HIVIEW/fw/cjson/test$

pppaulpeter avatar Jan 17 '22 13:01 pppaulpeter

cJSON seems to have no cJSON_SetStrValue function. But have cJSON_SetValuestring since v1.7.13

Alanscut avatar Jan 19 '22 02:01 Alanscut

cJSON seems to have no cJSON_SetStrValue function. But have cJSON_SetValuestring since v1.7.13

ok, i see. but when i replace the "cJSON_SetStrValue" with the "cJSON_SetValuestring" function, the application just segement fault, it is strange. so i just add the "cJSON_SetStrValue" to your source code then the problem is sovled.

pppaulpeter avatar Jan 25 '22 17:01 pppaulpeter

That's strange, would you mind providing your test case?

This lib also provide test case for cJSON_SetValuestring. https://github.com/DaveGamble/cJSON/blob/a6424b85dde200a87cac26451c6f0a6f3426681f/tests/misc_tests.c#L620-L653

Alanscut avatar Jan 27 '22 01:01 Alanscut