From d06baf7052e25b5c22424afe4cad341a56e2e829 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sun, 25 Mar 2018 14:25:46 +0200 Subject: [PATCH] is_{nan,infinity}: Wrap macro arguments in parentheses --- cJSON.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cJSON.c b/cJSON.c index 4886294..681a348 100644 --- a/cJSON.c +++ b/cJSON.c @@ -458,8 +458,8 @@ static void update_offset(printbuffer * const buffer) buffer->offset += strlen((const char*)buffer_pointer); } -#define is_nan(number) (number != number) -#define is_infinity(number) (!is_nan(number) && (number * 0) != 0) +#define is_nan(number) ((number) != (number)) +#define is_infinity(number) (!is_nan(number) && ((number) * 0) != 0) /* Render the number nicely from the given item into a string. */ static cJSON_bool print_number(const cJSON * const item, printbuffer * const output_buffer)