Comparison of double values will fail maximum of the time, so one desires to apply a contrast mechanism that allows for small variationslink.
Trying to send a very simple JSON string: The code i've written to do this: double num = 100; char *string_out; cJSON *bace = cJSON_CreateObject(); cJSON *mynum = NULL; mynum = cJSON_CreateNumber(num); cJSON_AddItemToObject(bace,"mynumber",mynum); cJSON_AddStringToObject(bace, "Message", "Hello" ); string_out= cJSON_PrintUnformatted(bace); printf(" \n "); printf(string_out); cJSON_Delete(bace); The output i receive is: Any ideas on why this is not working? I aslo tried the exmaple print code from...
I found the solution it was my fault because of an error. So cjson is working fine on that example. Sorry to disturb.
I found the solution it was my faut because of an error. So cjson is working fine on that example. Sorry to disturb.
Hi everyone, I am trying to parse a json text using cJson code. But when I parse the string I got an empty cJson object even if my string is not empty. Here is the link of my cjson text: https://api.bitfinex.com/v1/trades/ETHUSD It is a long text so here what it looks like: [{"timestamp":1496669950,"tid":35818880,"price":"240.43","amount":"0.07","exchange":"bitfinex","type":"buy"},{"timestamp":1496669946,"tid":35818879,"price":"240.52","amount":"8.63052622","exchange":"bitfinex","type":"buy"},{"timestamp":1496669946,"tid":35818878,"price":"240.51","amount":"10.2344","exchange":"bitfinex","type":"buy"},.......]...
So nobody can help me here ? Is there any limit on the number of column in the cjson file ? I do not understant why this object cannot be parsed by cjson. Please hep if you have some ideas thanks.
Hi everybody, I am trying to parse a cjson text but it does not work and I cannot find why. Here is the link of my cjson text: https://api.bitfinex.com/v1/trades/ETHUSD it is a long text so here what it looks like: [{"timestamp":1496669950,"tid":35818880,"price":"240.43","amount":"0.07","exchange":"bitfinex","type":"buy"},{"timestamp":1496669946,"tid":35818879,"price":"240.52","amount":"8.63052622","exchange":"bitfinex","type":"buy"},{"timestamp":1496669946,"tid":35818878,"price":"240.51","amount":"10.2344","exchange":"bitfinex","type":"buy"},.......]...
hi, when i use the cjson to encode a number type json on the CC3200 of Cortex M4...
hi, when i use the cjson to encode a number type json on the CC3200 of Cortex M4...
Hi, Sorry for the inconvenience. I believe it is only the term "patch" have been...
Heya, Just to bring to your attention - support for this project has moved to github:...
Hi David. Recently I am using your library for manipulating JSON documents, and came...
Great! Thanks for making this pretty easy. I'm repointing our projects to your upstream...
Hi, Kevin has done fantastic work. I'm really sorry I've been lax in supporting things....
Fixed some memory leak bugs when some heap allocation fails in cJSON_Create(String|*Array) functions
Fix printing of empty string pointers
Fix format problem with empty objects
Line that will never be executed.
Memory leaks in cJSON_Utils.c and test_utils.c
Incorrect boolean expression
cJSON can cause segment fault
Merged upstream at https://github.com/DaveGamble/cJSON, with thanks!
Merged upstream, again with thanks :)
Again, merged upstream (thanks to you and kbranigan! :)
Merged upstream, with thanks :)
Thankyou for this! These are merged upstream at https://github.com/DaveGamble/cJ...
Fixed upstream (thanks to kbranigan) at https://github.com/DaveGamble/cJSON
Accepted patch. Everything is moving to github at https://github.com/davegamble/cJSON...
Dave / Kevin - It's been a few months, have you figured out how you want to proceed?...
Thanks kolman ! However, we found that the suggested patch is still dangerous when...
In order to maintain source compatibility, new thread safe flavors for each of the...
In order to maintain source compatibility, the extra ep parameter could have a defualt...
Fixed print_number internal function from using ',' for decimal value separator for certain locale
Ugh.. the patch doesn't get formatted correctly when pasted inline. I'm attaching...
Fixed some memory leak bugs when some heap allocation fails in cJSON_Create(String|*Array) functions
Include stddef.h in cJSON.h for type "size_t"
Fix printing of empty string pointers
Fix format problem with empty objects
Line that will never be executed.
Memory leaks in cJSON_Utils.c and test_utils.c
Incorrect boolean expression
Hey, I forked your code a while ago on github and a bunch of people have added features...
hi, i have a problem: i have a json object containing a float number with 10 decimals....
Send fixes through? On Mon, Sep 14, 2015 at 9:32 AM, Arne B. Olsen abols1@users.sf.net...
Hi Is there any plans to fix the known bugs in the cJSON library? Using valgrind,...
I am bignner in C and was looking for some simple json api in C and found this the...
I'm attempting to create a two-string JSON body that holds the following: { "remote":...
Provide support for 64-bit integers
Hey, Thank you for the quick answer. It completely solved the problem. Actually to...
That resourceId lives inside the first array element in the items array, so you need...
Hi, I'm trying to parse JSON file from the youtube APIv3, but I get stuck in a point....
Hi, I'm trying to parse JSON file from the youtube APIv3, but I get stuck in a point....
if (cJSON_GetObjectItem(json,"interlace")->type) On Wed, Jun 17, 2015 at 3:36 PM,...
In the readme file I found this json example: { "name": "Jack (\"Bee\") Nimble",...
warning: floating constant exceeds range of 'double'
static const char *parse_string(cJSON *item,const char *str) { const char *ptr=str+1;char...
a simpler fix: cJSON.c file: 198d197 < const char * end_ptr = ptr; 204c203 < while...
a simpler fix: cJSON.c file: 198d197 < const char * end_ptr = ptr; 204c203 < while...
static unsigned parse_hex4(const char * & str) { unsigned h=0; if (str>='0' && str<='9')...
change uc2=parse_hex4(ptr+3);ptr+=6; to ptr+=3; uc2=parse_hex4(ptr); //ptr+=6;
cJSON can cause segment fault
Sure, I've pushed it to https://github.com/vibraphone/cjson-bson .
cJSON_Delete() unwanted behaviour
Thanks for your clear exposition of the issue. What you've found is an implementation...
cJSON_Delete() unwanted behaviour
Fix bug with the sort.
Since we anticipate repeated comparisons, add i...
As above, in svn rev 71.
Rework cJSON_Utils object compare functions to ...
Correct comment and variable declaration style ...
Fix comment style for proper ansi c compliance.
Replying to myself: I retract this statement. Years of my own use disagree. cJSON...
Incidentally, JSON Patch (which is in the cjson_utils stuff in svn) does include...
Fwiw, if you check svn, the latest repo contains some compare code. It's not in a...
BSON is a bit of a mess, but I'd consider it. Can you post a link to the code?
Hi Dave, Would you be interested in distributing an additional header and implementation...
print_string_ptr unsafe on platforms with signed char
Quite right. Fixed in svn rev68 and current files.
adjust the test very slightly
Optimise out escapable array.
print_string_ptr unsafe on platforms with signed char
Add more patch functionality and some more utils.
start of JSON Patch implementation. cJSON gaine...
rework cJSONUtils_GetPointer to avoid malloc/fr...
add cJSON_Utils which includes JSON Pointer imp...
fix formatting.
Added buffered printing methods for faster prin...
Performance optimization: replaced strcpy() with memcpy()
Performance optimization: replaced strcpy() with memcpy()
Excellent patch! Thanks! In svn rev 60.