From 733b8e958e64196b5f440fe5d631e45c7445a094 Mon Sep 17 00:00:00 2001 From: Gabriel Gritsch Date: Sun, 16 Feb 2014 10:54:19 +0100 Subject: [PATCH] Changes for SIZE_MAX --- jsmn.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/jsmn.c b/jsmn.c index 9ab2007..b54b941 100644 --- a/jsmn.c +++ b/jsmn.c @@ -1,7 +1,11 @@ #include -//#include // for UINT_MAX +//#include #include // for SIZE_MAX +#ifndef SIZE_MAX // SIZE_MAX came in C99 + #define SIZE_MAX ((size_t)-1) +#endif + #include "jsmn.h" /** @@ -144,7 +148,7 @@ static jsmnerr_t jsmn_parse_string(jsmn_parser *parser, const char *js, static inline jsmnerr_t jsmn_parse(jsmn_parser *parser, const char *js, jsmntok_t *tokens, unsigned int num_tokens) { - return jsmn_parseV2(parser, js, SIZE_MAX /*UINT_MAX*/, tokens, num_tokens); + return jsmn_parseV2(parser, js, SIZE_MAX, tokens, num_tokens); } /**