-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
json_setf does not work on empty json #26
Comments
PR please :) |
Is this project still active? I am also stuck with the issue as described here... |
Fix and send a PR. |
I were just about to report this issue and found it here :-) |
I have a fix for this (at least with how I was using it) but don't have the time ATM to do a PR... Here are the two functions that need to be modified:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
char json[50] = "{}";
char json_out[50];
struct json_out out = JSON_OUT_BUF(json_out, sizeof(json_out));
json_setf(json, sizeof(json), &out, ".somekey", "true");
only writes the value into json_out and thus creates an invalid json
printf("%s\n", json_out); // outut: "true"
The text was updated successfully, but these errors were encountered: