cJSON icon indicating copy to clipboard operation
cJSON copied to clipboard

Ultralightweight JSON parser in ANSI C

Results 187 cJSON issues
Sort by recently updated
recently updated
newest added

Hi, cJson When I use cJson in CGO products, I encounter some problems, sometimes length = sprintf((char*)number_buffer, "%1.15g", d); This line of code cannot handle integers normally, resulting in output...

So I just submitted an issue to the [AWS SDK](https://github.com/aws/aws-sdk-cpp/issues/1474) because I got an issue with them see the [stack overflow quesion](https://stackoverflow.com/questions/63990280/attaching-debugger-give-me-the-credentials-removing-it-and-the-credentials-are/64032536) for full details. TL;DR AWS SDK copied cJSON...

I recently noticed that when cJSON parses a JSON `true`, it sets `valueint` to `1`, which seems like a nice way to easly support number 0/1 and boolean false/true with...

```cpp #include #include "cjson/cJSON.h" void main() { cJSON *test = cJSON_CreateObject(); cJSON_AddBoolToObject(test, "test_bool", cJSON_False); printf("%s", cJSON_Print(test)); return; } ``` output: `❯ ./a.out { "test_bool": true }% ` is this ok?

Hi, cJSON, I have a problem. In nginx, a request or response body in JSON could be distributed across more than one buffer, so I must allocate a new buffer...

Would you like to [add more error handling](https://github.com/DaveGamble/cJSON/blob/0b5a7abf489e52d0e20a3de03bfffd674142b900/cJSON.c#L2241 "Update candidate: replace_item_in_object()") for return values from [a function like “cJSON_strdup”](https://github.com/DaveGamble/cJSON/blob/0b5a7abf489e52d0e20a3de03bfffd674142b900/cJSON.c#L159 "Duplicate a string.")?

enhancement

` cJSON *baseConfig = CONFIG_READ("base");` `if (baseConfig != NULL) {` ` DEBUG_ENABLE = (unsigned char) cJSON_GetObjectItem(baseConfig, "debug")->valueint;` ` strcpy(NETWORK_ETH, cJSON_GetObjectItem(baseConfig, "ethernet")->valuestring);` ` SensorReadTime = cJSON_GetObjectItem(baseConfig, "sensorTime")->valueint * 60;` ` SystemReadTime...

From 1.7.12 -> 1.7.13 this code was changed in add_item_to_array: ` static cJSON_bool add_item_to_array(cJSON *array, cJSON *item) { cJSON *child = NULL; if ((item == NULL) || (array == NULL))...