Commits

Serge Zaitsev committed 9a5f9aa

a proper fix for signed comparison

  • Participants
  • Parent commits eed485d

Comments (0)

Files changed (2)

 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++];
  */
 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;