diff --git a/cJSON.c b/cJSON.c index 4e4979e9..1a35f19b 100644 --- a/cJSON.c +++ b/cJSON.c @@ -1294,7 +1294,7 @@ CJSON_PUBLIC(char *) cJSON_PrintBuffered(const cJSON *item, int prebuffer, cJSON return (char*)p.buffer; } -CJSON_PUBLIC(cJSON_bool) cJSON_PrintPreallocated(cJSON *item, char *buffer, const int length, const cJSON_bool format) +CJSON_PUBLIC(cJSON_bool) cJSON_PrintPreallocated(const cJSON *item, char *buffer, int length, cJSON_bool format) { printbuffer p = { 0, 0, 0, 0, 0, 0, { 0, 0, 0 } }; diff --git a/cJSON.h b/cJSON.h index 218cc9ea..4b870195 100644 --- a/cJSON.h +++ b/cJSON.h @@ -160,7 +160,7 @@ CJSON_PUBLIC(char *) cJSON_PrintUnformatted(const cJSON *item); CJSON_PUBLIC(char *) cJSON_PrintBuffered(const cJSON *item, int prebuffer, cJSON_bool fmt); /* Render a cJSON entity to text using a buffer already allocated in memory with given length. Returns 1 on success and 0 on failure. */ /* NOTE: cJSON is not always 100% accurate in estimating how much memory it will use, so to be safe allocate 5 bytes more than you actually need */ -CJSON_PUBLIC(cJSON_bool) cJSON_PrintPreallocated(cJSON *item, char *buffer, const int length, const cJSON_bool format); +CJSON_PUBLIC(cJSON_bool) cJSON_PrintPreallocated(const cJSON *item, char *buffer, int length, cJSON_bool format); /* Delete a cJSON entity and all subentities. */ CJSON_PUBLIC(void) cJSON_Delete(cJSON *item);