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;