-
-
Notifications
You must be signed in to change notification settings - Fork 419
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 bug in StdStream.print
#4180
Conversation
Hi guys, this is my first PR here and I'm not totally sure this is the behavior we want. |
Hi @leonardoce, The changelog - fixed label was added to this pull request; all PRs with a changelog label need to have release notes included as part of the PR. If you haven't added release notes already, please do. Release notes are added by creating a uniquely named file in the The basic format of the release notes (using markdown) should be:
Thanks. |
When printing via `StdStream.print` strings containing the null terminator, we were just printing the string until the null terminator and replacing the unprinted characters by padding the printed string with space characters. This behavior made `String.size()` inconsistent with what `fprintf` was really printing. This behavior has been introduced in #1768, which ensure we respected the buffer size. Closes #4171
Added the release notes snippet |
.release-notes/4180.md
Outdated
|
||
That behavior was introduced in release 0.12.0, fixing a left-over from when Pony strings were null terminated. | ||
|
||
Now `Stdstream.print` is effectively printing every character in the string plus an ending newline character. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what this is supposed to mean. What is "effectively printing"? Does "effectively" here mean "more or less"? If yes, that would be a disturbing release note and I think it should be rewritten.
I would rewrite this, but I'm not sure what the intent is...
We don't have a way to test this right now in an automated fashion so I will build this branch and test by hand: actor Main
new create(env: Env) =>
env.out.print("Hello,\x00world!") |
StdStream.print
StdStream.print
Tested. This is looking good. |
I'll merge this later. |
Thanks @leonardoce. |
When printing via
StdStream.print
strings containing the nullterminator, we were just printing the string until the null terminator
and replacing the unprinted characters by padding the printed string
with space characters.
This behavior made
String.size()
inconsistent with whatfprintf
wasreally printing.
This behavior has been introduced in #1768, which ensure we respected
the buffer size.
Closes #4171