[Issue 927] writefln() is duplicating values for parameters supplied
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Feb 3 11:17:53 PST 2007
http://d.puremagic.com/issues/show_bug.cgi?id=927
bugzilla at digitalmars.com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |INVALID
------- Comment #2 from bugzilla at digitalmars.com 2007-02-03 13:17 -------
char[]
FourCharCodeAsString(FourCharCode inVal)
{
char[4] s;
...
return s;
^^^ this is the bug, returning a reference to a local, try:
return s.dup;
}
BTW, the next release of the compiler will give a compile time error for this,
which should help, as it seems to come up frequently.
--
More information about the Digitalmars-d-bugs
mailing list