Bug fixes for reading integers and the ability to read JSON embeded in a zeromq message which is not null terminated #38

Open
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants

Allow parsing of non-null terminated JSON data and fix integer validation logic

  • Add input_size to yajl_tree_parse to allow for non-null terminated data
  • Add endptr to yajl_parse_integer to fix handle_number in yajl_tree.c
  • Fix 64 bit conversion warnings in yajl_tree_get
  • Fix a typo in documentation the for the error_buffer_size parameter of yajl_tree_parse
Allow parsing of non-null terminated JSON data and fix integer valida…
…tion logic

 * Add input_size to yajl_tree_parse to allow for non-null terminated data
 * Add endptr to yajl_parse_integer to fix handle_number in yajl_tree.c
 * Fix 64 bit conversion warnings in yajl_tree_get
 * Fix a typo in documentation the for the error_buffer_size parameter of yajl_tree_parse

lloyd commented on ea419e8 May 26, 2011

I love this patch. My only problem is that this constitues an API breaking change. I think the only proper thing to do here is to create a new function that accepts a length and preserve the signature of the old one. (yajl_tree_parsen? yajl_tree_parse_len?)

It's not pretty, but there's already code out there that would break if we change the api.

Owner

azverkan replied May 26, 2011

There any documentation the API policy for the project?

I wasn't sure whether the project preferred a clean API or if backwards compatibility took priority.

Not explicitly documented, but the project follows semantic versioning. Yajl 2 was just released so another major release so early would cause undue pain and suffering.

I'll merge your changes today or tommorow. Thanks for the contribution!

Also fixed in b3a1e0b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment