String created from buffer has wrong length and strip() result is incorrect

ketmar via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Oct 17 08:33:28 PDT 2014


On Fri, 17 Oct 2014 18:30:43 +0300
ketmar via Digitalmars-d-learn <digitalmars-d-learn at puremagic.com>
wrote:

> > Shouldn't the compiler give a warning about casting a 
> > buffer to a string without using fromStringz?
nope. such casting is perfectly legal, as D strings can contain
embedded '\0's.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20141017/7e723485/attachment.sig>


More information about the Digitalmars-d-learn mailing list