Bug 8811 – [snn] sscanf %n bug

Status
REOPENED
Severity
normal
Priority
P3
Component
druntime
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2012-10-13T07:52:34Z
Last change time
2024-12-07T13:32:09Z
Keywords
bootcamp
Assigned to
No Owner
Creator
stas
Moved to GitHub: dmd#17246 →

Comments

Comment #0 by stasoid — 2012-10-13T07:52:34Z
Applies to: DMD 2.060 System: Windows XP SP3 sscanf %n incorrectly works after reading last character. Code: import std.stdio, std.string; alias toStringz z; void main() { int n; sscanf("a".z, "a%n".z, &n); assert(n==1); // fail }
Comment #1 by andrei — 2016-10-15T17:22:27Z
The call sscanf("a".z, "a%n".z, &n); is invalid.
Comment #2 by andrei — 2016-10-15T17:24:43Z
Ah, my bad, it's sscanf not scanf. Tried it just now with dpaste, works.
Comment #3 by andrei — 2016-10-15T17:25:16Z
Wait, the bug is reported on Windows, not Posix. Reopening...
Comment #4 by robert.schadek — 2024-12-07T13:32:09Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17246 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB