diff --git a/fx/string.c b/fx/string.c index 68a584d..6c9976c 100644 --- a/fx/string.c +++ b/fx/string.c @@ -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;