[Issue 21741] New: std.format: %0*d produces int.max zeros

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Mar 21 18:48:55 UTC 2021


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

          Issue ID: 21741
           Summary: std.format: %0*d produces int.max zeros
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: bugzilla at bernis-buecher.de

Taken from https://issues.dlang.org/show_bug.cgi?id=15386:

Not only the 'internal' ones, but also from public functions, this issue can be
reproduced:

void main()
{
    import std.stdio;
    "%(%0*d%)".writefln(new int[1]);
}

I intended to specify equal width for each element of an array, put the width
before new int[1] and got a runtime error. Removing the width from the
arguments, I've come up with this code.

--


More information about the Digitalmars-d-bugs mailing list