Closed ker2x closed 10 years ago
This repository is not for jsmn itself. This is just my example code for jsmn, which you do not appear to be using. Please direct jsmn questions to the author: http://zserge.com/jsmn.html
To answer your question: t.size is the number of child tokens, not the byte length of the token in the input stream. From the docs:
typedef struct {
jsmntype_t type; /* Token type */
int start; /* Token start position */
int end; /* Token end position */
int size; /* Number of child (nested) tokens */
} jsmntok_t;
So you are not incorrect about using t.end - t.start
.
Oooops wrong repo, sorry about that and thank you for your instant reply ! Have a nice day \o/
Friendly greetings ! I'm running this code :
i have to use "t.end - t.start" because t.size is always 0. am i doing something wrong ? am i mistaken about size ? is it a bug ? thank you