[Issue 8811] New: sscanf %n bug

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Oct 13 07:52:36 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=8811

           Summary: sscanf %n bug
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: druntime
        AssignedTo: nobody at puremagic.com
        ReportedBy: stasoid at yahoo.com


--- Comment #0 from stas <stasoid at yahoo.com> 2012-10-13 07:52:34 PDT ---
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
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list