From 86350f2bb1681c573abd44018ee49883989008dd Mon Sep 17 00:00:00 2001 From: "Serge A. Zaitsev" Date: Sun, 9 Feb 2014 17:09:15 +0200 Subject: [PATCH] a proper fix for signed comparison --- jsmn.c | 2 +- jsmn.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/jsmn.c b/jsmn.c index a8e71ac..2956230 100644 --- a/jsmn.c +++ b/jsmn.c @@ -8,7 +8,7 @@ static jsmntok_t *jsmn_alloc_token(jsmn_parser *parser, jsmntok_t *tokens, size_t num_tokens) { jsmntok_t *tok; - if (parser->toknext >= (int) num_tokens) { + if (parser->toknext >= num_tokens) { return NULL; } tok = &tokens[parser->toknext++]; diff --git a/jsmn.h b/jsmn.h index 03b2c1a..5aa6e3c 100644 --- a/jsmn.h +++ b/jsmn.h @@ -48,7 +48,7 @@ typedef struct { */ typedef struct { unsigned int pos; /* offset in the JSON string */ - int toknext; /* next token to allocate */ + unsigned int toknext; /* next token to allocate */ int toksuper; /* superior token node, e.g parent object or array */ } jsmn_parser;