[Issue 2613] New: The trivial hello.d sample program fails at execution

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jan 24 12:40:25 PST 2009


http://d.puremagic.com/issues/show_bug.cgi?id=2613

           Summary: The trivial hello.d sample program fails at execution
           Product: D
           Version: 2.023
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: PhiBerthault at Orange.fr


The hello.d sample programs shows parasite characters when invoked.
The problem comes from missing nul terminating character in D strings.

The line:
    printf("args[%d] = '%s'\n", i, cast(char *)args[i]);
must be rewritten as:
    printf("args[%d] = '%.*s'\n", i, args[i]);

There is the same error in the unittest.d program in Phobos.


-- 



More information about the Digitalmars-d-bugs mailing list