www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20393] New: formattedRead accepts input, that should be

https://issues.dlang.org/show_bug.cgi?id=20393

          Issue ID: 20393
           Summary: formattedRead accepts input, that should be rejected
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: bugzilla d-ecke.de

---
import std.format;

void main()
{
    string str = "foo 12a-buzz";
    string a, c;
    int b;
    formattedRead(str, "%s %d-%s", &a, &b, &c);

    assert(c == "a"); // just for showing, what happens
}
---

Should throw an exception but doesn't.

--
Nov 14 2019