aboutsummaryrefslogtreecommitdiff
path: root/lib/lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/lib.c')
-rw-r--r--lib/lib.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/lib.c b/lib/lib.c
index 5923176c..33be44b6 100644
--- a/lib/lib.c
+++ b/lib/lib.c
@@ -177,7 +177,7 @@ struct string_list **splitpath(char *path, struct string_list **list)
if (len > 0) {
*list = xmalloc(sizeof(struct string_list) + len + 1);
(*list)->next = 0;
- strncpy((*list)->str, new, len);
+ memcpy((*list)->str, new, len);
(*list)->str[len] = 0;
list = &(*list)->next;
}
@@ -210,7 +210,8 @@ struct string_list *find_in_path(char *path, char *filename)
if (!len) sprintf(rnext->str, "%s/%s", cwd, filename);
else {
char *res = rnext->str;
- strncpy(res, path, len);
+
+ memcpy(res, path, len);
res += len;
*(res++) = '/';
strcpy(res, filename);