Commit c67fbc52 authored by Sebastian Ramacher's avatar Sebastian Ramacher

Fix strncpy warning

parent 7b1d9dcf
...@@ -416,7 +416,7 @@ girara_replace_substring(const char* string, const char* old, const char* new) ...@@ -416,7 +416,7 @@ girara_replace_substring(const char* string, const char* old, const char* new)
char* iter = ret; char* iter = ret;
while (*string != '\0') { while (*string != '\0') {
if (strstr(string, old) == string) { if (strstr(string, old) == string) {
strncpy(iter, new, new_len); strncpy(iter, new, new_len + 1);
iter += new_len; iter += new_len;
string += old_len; string += old_len;
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment