Skip to content
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

Print unprintable characters in memory buffer #505

Merged
merged 1 commit into from Jul 21, 2016
Merged

Print unprintable characters in memory buffer #505

merged 1 commit into from Jul 21, 2016

Conversation

smititelu
Copy link
Contributor

I did this PR, analogous to PR #497. Besides compilation, didn't actually tested it. Tell me if you spot any issues.

smititelu referenced this pull request Jul 19, 2016
In order to print the msgpack object in a memory buffer.
@@ -344,9 +369,11 @@ int msgpack_object_print_buffer(char *buffer, size_t buffer_size, msgpack_object
ret = snprintf(aux_buffer, aux_buffer_size, "\"");
aux_buffer = aux_buffer + ret;
aux_buffer_size = aux_buffer_size - ret;
ret = snprintf(aux_buffer, aux_buffer_size, "%.*s", o.via.ext.size, o.via.ext.ptr);

ret = msgpack_object_bin_print_buffer(aux_buffer, aux_buffer_size, o.via.bin.ptr, o.via.bin.size);
aux_buffer = aux_buffer + ret;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smititelu , thank you for sending the PR.

It seems that

, o.via.bin.ptr, o.via.bin.size);

should be

, o.via.ext.ptr, o.via.ext.size);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Thanks for spotting this.

@redboltz redboltz merged commit 95b31d0 into msgpack:master Jul 21, 2016
@redboltz
Copy link
Contributor

merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants