fx: string: handle string_duplicate not copying the null terminator
This commit is contained in:
+1
-1
@@ -301,7 +301,7 @@ static fx_string *string_duplicate(const struct fx_string_p *str)
|
||||
const char *src = string_ptr(str);
|
||||
char *dst = string_ptr(new_str_p);
|
||||
|
||||
memcpy(dst, src, str->s_len);
|
||||
memcpy(dst, src, str->s_len + 1);
|
||||
new_str_p->s_len = str->s_len;
|
||||
new_str_p->s_codepoints = str->s_codepoints;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user