From 2148e3277a00afc139ede78fdc076984b40258c6 Mon Sep 17 00:00:00 2001 From: Pawel Winogrodzki Date: Thu, 30 Mar 2017 15:47:06 -0700 Subject: [PATCH] Renaming "min" to "cjson_min". --- cJSON.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cJSON.c b/cJSON.c index 9a50326..d1f1e9b 100644 --- a/cJSON.c +++ b/cJSON.c @@ -1046,9 +1046,7 @@ CJSON_PUBLIC(cJSON *) cJSON_Parse(const char *value) return cJSON_ParseWithOpts(value, 0, 0); } -#ifndef min -#define min(a, b) ((a < b) ? a : b) -#endif +#define cjson_min(a, b) ((a < b) ? a : b) static unsigned char *print(const cJSON * const item, cJSON_bool format, const internal_hooks * const hooks) { @@ -1087,7 +1085,7 @@ static unsigned char *print(const cJSON * const item, cJSON_bool format, const i { goto fail; } - memcpy(printed, buffer->buffer, min(buffer->length, buffer->offset + 1)); + memcpy(printed, buffer->buffer, cjson_min(buffer->length, buffer->offset + 1)); printed[buffer->offset] = '\0'; /* just to be sure */ /* free the buffer */