a proper fix for signed comparison

master
Serge A. Zaitsev 11 years ago
parent da95978033
commit 86350f2bb1

@ -8,7 +8,7 @@
static jsmntok_t *jsmn_alloc_token(jsmn_parser *parser, static jsmntok_t *jsmn_alloc_token(jsmn_parser *parser,
jsmntok_t *tokens, size_t num_tokens) { jsmntok_t *tokens, size_t num_tokens) {
jsmntok_t *tok; jsmntok_t *tok;
if (parser->toknext >= (int) num_tokens) { if (parser->toknext >= num_tokens) {
return NULL; return NULL;
} }
tok = &tokens[parser->toknext++]; tok = &tokens[parser->toknext++];

@ -48,7 +48,7 @@ typedef struct {
*/ */
typedef struct { typedef struct {
unsigned int pos; /* offset in the JSON string */ 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 */ int toksuper; /* superior token node, e.g parent object or array */
} jsmn_parser; } jsmn_parser;

Loading…
Cancel
Save