www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13065] New: writeln doesn't print the whole fixed size array

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

          Issue ID: 13065
           Summary: writeln doesn't print the whole fixed size array of
                    chars in some cases
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: normal
          Priority: P1
         Component: Phobos
          Assignee: nobody puremagic.com
          Reporter: bearophile_hugs eml.cc

void main() {
    import std.stdio: writeln;
    char[10] buf = 'X';
    buf[5] = '\0';
    writeln(buf);
    writeln("", buf);
}


Output:

XXXXX
XXXXX XXXX


Expected Output:

XXXXX XXXX
XXXXX XXXX

--
Jul 07 2014