Source

jsmn / jsmn.c

Diff from to
 static jsmntok_t *jsmn_alloc_token(jsmn_parser *parser, 
 		jsmntok_t *tokens, size_t num_tokens) {
 	unsigned int i;
-	for (i = parser->curtoken; i < num_tokens; i++) {
+	for (i = parser->toknext; i < num_tokens; i++) {
 		if (tokens[i].start == -1 && tokens[i].end == -1) {
-			parser->curtoken = i;
+			parser->toknext = i + 1;
 			tokens[i].size = 0;
 			return &tokens[i];
 		}
 	jsmntok_t *token;
 
 	/* initialize the rest of tokens (they could be reallocated) */
-	for (i = parser->curtoken; i < num_tokens; i++) {
+	for (i = parser->toknext; i < num_tokens; i++) {
 		jsmn_fill_token(&tokens[i], JSMN_PRIMITIVE, -1, -1);
 	}
 
 				break;
 			case '}': case ']':
 				type = (c == '}' ? JSMN_OBJECT : JSMN_ARRAY);
-				for (i = parser->curtoken; i >= 0; i--) {
+				for (i = parser->toknext - 1; i >= 0; i--) {
 					token = &tokens[i];
 					if (token->start != -1 && token->end == -1) {
 						if (token->type != type) {
  */
 void jsmn_init(jsmn_parser *parser) {
 	parser->pos = 0;
-	parser->curtoken = 0;
+	parser->toknext = 0;
 	parser->cursize = NULL;
 }