Skip to content

Commit 00a94e0

Browse files
committed
fix small string
1 parent 01676b2 commit 00a94e0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

source/mir/small_string.d

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,9 @@ extern(D):
109109
version(D_Exceptions) throw exception;
110110
else assert(0, errorMsg);
111111
}
112+
_data = '\0';
112113
if (__ctfe)
113-
(cast(ubyte[])_data)[0 .. str.length] = cast(ubyte[]) str;
114+
(cast(char[])_data)[0 .. str.length] = cast(char[]) str;
114115
else
115116
memcpy(_data.ptr, str.ptr, str.length);
116117
return this;

0 commit comments

Comments
 (0)