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

Fix off-by-one error in String.cstring #2616

Merged
merged 1 commit into from
Mar 31, 2018
Merged

Fix off-by-one error in String.cstring #2616

merged 1 commit into from
Mar 31, 2018

Conversation

mfelsche
Copy link
Contributor

@mfelsche mfelsche commented Mar 28, 2018

that could surface if the newly allocated cstring buffer is not set to 0 .

Fixes #2613

that could surface if the newly allocated cstring buffer is not set ot 0 completely
@mfelsche mfelsche added the changelog - fixed Automatically add "Fixed" CHANGELOG entry on merge label Mar 28, 2018
@jemc jemc changed the title fix off-by-one error in String.cstring Fix off-by-one error in String.cstring Mar 28, 2018
@slfritchie
Copy link
Contributor

This patch fixes an intermittent junk byte that I see in a Wallaroo integration test that prints output with @printf[I32]("output: %s\n".cstring(), s.cstring()), where s is generated within a Wallaroo pipeline. The junk byte would appear after the last character of s and the newline.

Before the patch, the fraction of lines with a junk byte is something like 0.5% of printed list. With this patch, 0% of lines have a junk byte.

@jemc jemc merged commit 1190a57 into master Mar 31, 2018
@jemc jemc deleted the cstring-off-by-one branch March 31, 2018 14:32
ponylang-main added a commit that referenced this pull request Mar 31, 2018
dipinhora pushed a commit to dipinhora/ponyc that referenced this pull request Jun 5, 2018
that could surface if the newly allocated cstring buffer is not set ot 0 completely
dipinhora pushed a commit to dipinhora/ponyc that referenced this pull request Jun 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog - fixed Automatically add "Fixed" CHANGELOG entry on merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants