[Issue 20392] New: formattedRead: %*d and %d should read the same
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Nov 14 18:14:48 UTC 2019
https://issues.dlang.org/show_bug.cgi?id=20392
Issue ID: 20392
Summary: formattedRead: %*d and %d should read the same
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: phobos
Assignee: nobody at puremagic.com
Reporter: bugzilla at d-ecke.de
This throws an exception:
---
import std.format;
void main()
{
string str = "foo bar buzz";
string a, c;
int b;
formattedRead(str, "%s %d %s", &a, &b, &c);
}
---
This not:
---
import std.format;
void main()
{
string str = "foo bar buzz";
string a, c;
formattedRead(str, "%s %*d %s", &a, &c);
}
---
The reason is, that %*d accepts an empty string as a number while %d doesn't.
--
More information about the Digitalmars-d-bugs
mailing list