Summary: Truncation of long string by std.stdio.write
           Product: D
           Version: 2.026
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos


The file middle.txt at the URL above has lines numbered up to 555. If I read it
into a string and std.stdio.write the string to the console, the output is
truncated at line 261.

import std.file;
import std.stdio;
import std.c.stdio;

void main()
   string s2 = cast(immutable(char[]))"middle.txt");
   printf("%s", (s2 ~ "\x00").ptr);

It isn't, as I got similar behavior when the string was output to
the console from the program that generated middle.txt - then it was at line

I checked the string for embedded zeroes and 0x1a when it was doing the fail at
221, but it seemed to be OK.

printf works as expected.

I'm sorry I can't come up with anything more compact than this, and I'm
probably missing something stupid.



Reply via email to