Repository navigation
Fix snippet buffered read logic - #8560
Conversation
|
Tagging subscribers to this area: @dotnet/area-system-io Issue DetailsThe snippet generates a file with 215 bytes. Fix buffered reading to be technically correct and work for arbitrary file contents. Fixes #4141
|
The snippet generates a file with 215 bytes. It reads the file with a 1024 byte buffer. While this works with a new 0-initialized buffer, the buffered reading misses using the returned read bytes count. A file with > 1024 bytes will reuse the now non-0 buffer and print unintended values. Fix buffered reading to be technically correct and work for arbitrary file contents. Fixes dotnet#4141
|
Learn Build status updates of commit b017ccc: ✅ Validation status: passed
For more details, please refer to the build report. Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report. For any questions, please:
|
|
Learn Build status updates of commit b054d8c: ✅ Validation status: passed
For more details, please refer to the build report. Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report. For any questions, please:
|
adamsitnik
left a comment
There was a problem hiding this comment.
LGTM, thank you @Kissaki !
|
The CI leg is red due to missing solution file. I've verified manually that the provided code builds fine: |
The snippet generates a file with 215 bytes.
It reads the file with a 1024 byte buffer.
While this works with a new 0-initialized buffer, the buffered reading misses using the returned read bytes count.
A file with > 1024 bytes will reuse the now non-0 buffer and print unintended values.
Fix buffered reading to be technically correct and work for arbitrary file contents.
Fixes #4141