refactor: strncpy -> strlcpy

This commit is contained in:
2025-11-10 14:13:27 +01:00
parent f5bf71f535
commit 352f97c2db
7 changed files with 22 additions and 17 deletions
+2 -2
View File
@@ -63,8 +63,8 @@ char *string_replace_at(char *src, unsigned int from, unsigned int to,
dst = malloc(src_len - (to - from) + rpl_len + 1);
strncpy(dst, src, from);
strncpy(dst + from, rpl, rpl_len);
strlcpy(dst, src, from + 1);
strlcpy(dst + from, rpl, rpl_len + 1);
strlcpy(dst + from + rpl_len, src + to, src_len - to + 1);
return dst;