We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d4dbde5 commit 4418e9fCopy full SHA for 4418e9f
source/mir/small_string.d
@@ -109,11 +109,11 @@ extern(D):
109
version(D_Exceptions) throw exception;
110
else assert(0, errorMsg);
111
}
112
- _data = '\0';
113
if (__ctfe)
114
- (cast(char[])_data)[0 .. str.length] = cast(char[]) str;
+ _data[0 .. str.length] = str;
115
else
116
memcpy(_data.ptr, str.ptr, str.length);
+ _data[str.length .. $] = '\0';
117
return this;
118
119
@@ -184,7 +184,7 @@ extern(D):
184
{
185
_data = '\0';
186
187
188
189
190
0 commit comments