[Issue 21034] concatenation with a string literal could also append the trailing null

2023-07-14 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21034

--- Comment #2 from Basile-z  ---
More simply:  the result of `LHS ~ RHS` should be guaranteed to be zero
terminated when RHS is a StringExp.

--


[Issue 21034] concatenation with a string literal could also append the trailing null

2023-07-14 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21034

Salih Dincer  changed:

   What|Removed |Added

 CC||sali...@hotmail.com

--


[Issue 21034] concatenation with a string literal could also append the trailing null

2023-07-14 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21034

Nick Treleaven  changed:

   What|Removed |Added

 CC||n...@geany.org

--- Comment #1 from Nick Treleaven  ---
The assert would fail anyway, because "0123" is immutable data. When you assign
"0" to s, that is different memory and cannot affect c.

Presumably this request is for:

s = "0";
s = s ~ "1";
assert(s.ptr[2] == '\0');

That would cause unnecessary writes when appending a (short) string in a loop
and each null byte is not read.

--


[Issue 21034] concatenation with a string literal could also append the trailing null

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21034

Iain Buclaw  changed:

   What|Removed |Added

   Priority|P1  |P4

--