Specifically, the error was with the "id" item - "id": 375288199918391296.
The error message I received is likely to be platform-specific (I am running this on an IBM i) and was "Invalid floating-point format change detected" - but essentially the code is trying to put the value 375288199918391296 into an int in the parse_number function - and the value being too large to fit into an int, it blows up.
I encountered an error in cJSON when parsing JSON text that contains a long numeric value.
The error occurred parsing the following JSON response (from Twitter) :-
Specifically, the error was with the "id" item - "id": 375288199918391296.
The error message I received is likely to be platform-specific (I am running this on an IBM i) and was "Invalid floating-point format change detected" - but essentially the code is trying to put the value 375288199918391296 into an int in the parse_number function - and the value being too large to fit into an int, it blows up.
The code currently does the following :
I have amended this in my source to be :
This works and allows the JSON to be parsed.. however I am not a C expert and this may not be the best approach to have taken?
Regards