adding string length to string objects#470
Open
alljoynsville wants to merge 4 commits intoDaveGamble:masterfrom
Open
adding string length to string objects#470alljoynsville wants to merge 4 commits intoDaveGamble:masterfrom
alljoynsville wants to merge 4 commits intoDaveGamble:masterfrom
Conversation
added 3 commits
May 24, 2020 20:38
there is an isssue with the strings in this library. on one hand when parsing the string it's parsed from \" till \" on the other hand when you want to actually get the data it's aviable but if you had something like this: "data\u0000\n" it's a problem since the \0 is before the end of the string. To solve the zero teminrated string i added an extra value stringvalue_len that can be retrived using a function that holds the length of the pased string. The length takes into account the parsing of special escaped chars.
Alanscut
reviewed
Jun 17, 2020
| /* The item's number, if type==cJSON_Number */ | ||
| double valuedouble; | ||
|
|
||
| uint64_t valueint64; |
Collaborator
There was a problem hiding this comment.
change the cJSON struct and add new feature of C99 is a break change, it will cause incompatibility with C89. I think it should be implemented in v2.0
Author
There was a problem hiding this comment.
crap... the int64 is a temp feature i added since i need int64 support and i think it's implemented badly as i need it now and didn't have time to architect it properly.
i'll open a new PR without it, maybe from a side branch.
I was sure the PR will not change after a commit to the tip of the master :-\
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
there is an isssue with the strings in this library.
on one hand when parsing the string it's parsed from " till "
on the other hand when you want to actually get the data it's aviable
but if you had something like this: "data\u0000\n" it's a problem since
the \0 is before the end of the string.
To solve the zero teminrated string i added an extra value
stringvalue_len that can be retrived using a function that holds the
length of the pased string. The length takes into account the parsing of
special escaped chars.