zserge / jsmn

Jsmn is a world fastest JSON parser/tokenizer. This is the official repo replacing the old one at Bitbucket
MIT License
3.64k stars 778 forks source link

Default "example/simple.c" not working #208

Closed mihir-chauhan closed 3 years ago

mihir-chauhan commented 3 years ago

Hey! I was trying this out and what I did is used the examples/simple.c program and then just added the jsmn.h to the directory. When it runs, it prints out:

- User: ERROR*s
- Admin: ERROR*s
- UID: ERROR*s
- Groups:
  * ERROR*s
  * ERROR*s
  * ERROR*s
  * ERROR*s

Is there anything I am doing wrong? Thank you.

mihir-chauhan commented 3 years ago

By the way, at the top, I do: #include "jsmn.h"

pt300 commented 3 years ago

It seems like a problem with libc on your system not supporting the "%.*s" in printf. That means it's an issue with printing in the example, not JSMN itself.

mihir-chauhan commented 3 years ago

Yes, I spent some time and found the solution. Thank you!