www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8811] New: sscanf %n bug

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 puremagic.com
        ReportedBy: stasoid yahoo.com



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: -------
Oct 13 2012