Skip to content

fix(stdlib): string writers terminate their own output (#1817) - #1834

Open
ghaith wants to merge 2 commits into
release/1.0.xfrom
backport/1.0.x/stdlib-string-writers
Open

fix(stdlib): string writers terminate their own output (#1817)#1834
ghaith wants to merge 2 commits into
release/1.0.xfrom
backport/1.0.x/stdlib-string-writers

Conversation

@ghaith

@ghaith ghaith commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Backport of #1817 to release/1.0.x (cherry-pick of 6d4efe1).

🤖 Generated with Claude Code

The *_TO_STRING writers relied on the caller zero-filling the whole
result buffer: they wrote content without a trailing terminator, and
TIME_TO_STRING_EXT even located its write position by scanning for the
first zero byte. STRING_TO_WSTRING_EXT, CHAR_TO_STRING and
WCHAR_TO_WSTRING had the same gap; the string_functions writers already
terminate through the encoders.

Every writer now terminates what it writes (via a cursor-tracking
write_terminated helper for the formatted conversions), so results stay
well-formed regardless of the destination buffer's prior contents.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
(cherry picked from commit 6d4efe1)
@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown

Build Artifacts

🪟 Windows

Artifact Link Size
stdlib.lib Download 4.0 MB
stdlib.dll Download 0.1 MB
plc.exe Download 38.3 MB

From workflow run

🐧 Linux

Artifact Link Size
deb-x86_64 Download 10.9 MB
schema Download 0.0 MB
stdlib Download 33.5 MB
plc-x86_64 Download 43.5 MB
deb-aarch64 Download 5.4 MB
plc-aarch64 Download 43.3 MB

From workflow run

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.

2 participants