cJSON

mirror of Dave's cJSON
git clone git://git.thc420.xyz/cJSON
Log | Files | Refs | README | LICENSE

commit af6d5d3d7c1538b7a13ede72da76a0d582fc5441
parent cf9d57d56cac21fc59465b8d26cf29bf6d2a87b3
Author: Max Bruckner <max@maxbruckner.de>
Date:   Fri,  3 Feb 2017 22:41:14 +0100

Add more consts to unsigned chars

Diffstat:
McJSON.c | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/cJSON.c b/cJSON.c @@ -322,14 +322,14 @@ static unsigned char* ensure(printbuffer *p, size_t needed) /* calculate the new length of the string in a printbuffer */ static size_t update(const printbuffer *p) { - unsigned char *str = NULL; + const unsigned char *str = NULL; if (!p || !p->buffer) { return 0; } str = p->buffer + p->offset; - return p->offset + strlen((char*)str); + return p->offset + strlen((const char*)str); } /* Render the number nicely from the given item into a string. */ @@ -510,7 +510,7 @@ static const unsigned char firstByteMark[7] = static const unsigned char *parse_string(cJSON *item, const unsigned char *str, const unsigned char **ep) { const unsigned char *ptr = str + 1; - const unsigned char *end_ptr =str + 1; + const unsigned char *end_ptr = str + 1; unsigned char *ptr2 = NULL; unsigned char *out = NULL; size_t len = 0;