DaveGamble / cJSON

Ultralightweight JSON parser in ANSI C
MIT License
10.28k stars 3.15k forks source link

const-qualify cJSON * in cJSON_PrintPreallocated #822

Open escherstair opened 5 months ago

escherstair commented 5 months ago

Like all the other cJSON_Print functions, I think that cJSON *item parameter can be const-qualified in cJSON_PrintPreallocated too https://github.com/DaveGamble/cJSON/blob/87d8f0961a01bf09bef98ff89bae9fdec42181ee/cJSON.c#L1297C50-L1297C61 should be changed to

CJSON_PUBLIC(cJSON_bool) cJSON_PrintPreallocated(const cJSON *item, char *buffer, const int length, const cJSON_bool format)

I opened PR #823