Bug 23488 – std.format.sformat mishandles char ranges

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-11-15T20:04:11Z
Last change time
2022-11-17T07:23:06Z
Keywords
pull
Assigned to
No Owner
Creator
ag0aep6g

Comments

Comment #0 by ag0aep6g — 2022-11-15T20:04:11Z
struct R { string s = "Ü"; bool empty() { return s.length == 0; } char front() { return s[0]; } void popFront() { s = s[1 .. $]; } } void main() { import std.format: sformat; char[2] buf; assert(sformat(buf, "%s", R()) == "Ü"); /* fails; should pass */ }
Comment #1 by dlang-bot — 2022-11-15T20:12:00Z
@aG0aep6G created dlang/phobos pull request #8626 "fix issue 23488 - std.format.sformat mishandles char ranges" fixing this issue: - fix issue 23488 - std.format.sformat mishandles char ranges https://github.com/dlang/phobos/pull/8626
Comment #2 by dlang-bot — 2022-11-17T07:23:06Z
dlang/phobos pull request #8626 "fix issue 23488 - std.format.sformat mishandles char ranges" was merged into master: - 26c7f44de8ac7bec4fbe8df968fd351dbac1c915 by aG0aep6G: fix issue 23488 - std.format.sformat mishandles char ranges https://github.com/dlang/phobos/pull/8626