btrfs: s/strncat()/strlcat()/g

parent 1963c60d
...@@ -159,6 +159,10 @@ if !HAVE_STRLCPY ...@@ -159,6 +159,10 @@ if !HAVE_STRLCPY
liblxc_la_SOURCES += ../include/strlcpy.c ../include/strlcpy.h liblxc_la_SOURCES += ../include/strlcpy.c ../include/strlcpy.h
endif endif
if !HAVE_STRLCAT
liblxc_la_SOURCES += ../include/strlcat.c ../include/strlcat.h
endif
if !HAVE_GETGRGID_R if !HAVE_GETGRGID_R
liblxc_la_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h liblxc_la_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h
endif endif
...@@ -316,6 +320,10 @@ if !HAVE_STRLCPY ...@@ -316,6 +320,10 @@ if !HAVE_STRLCPY
init_lxc_static_SOURCES += ../include/strlcpy.c ../include/strlcpy.h init_lxc_static_SOURCES += ../include/strlcpy.c ../include/strlcpy.h
endif endif
if !HAVE_STRLCAT
init_lxc_static_SOURCES += ../include/strlcat.c ../include/strlcat.h
endif
if !HAVE_GETGRGID_R if !HAVE_GETGRGID_R
liblxc_la_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h liblxc_la_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h
endif endif
......
...@@ -46,6 +46,10 @@ ...@@ -46,6 +46,10 @@
#include "include/strlcpy.h" #include "include/strlcpy.h"
#endif #endif
#ifndef HAVE_STRLCAT
#include "include/strlcat.h"
#endif
lxc_log_define(btrfs, lxc); lxc_log_define(btrfs, lxc);
/* /*
...@@ -89,8 +93,8 @@ char *get_btrfs_subvol_path(int fd, u64 dir_id, u64 objid, char *name, ...@@ -89,8 +93,8 @@ char *get_btrfs_subvol_path(int fd, u64 dir_id, u64 objid, char *name,
if (!retpath) if (!retpath)
return NULL; return NULL;
(void)strlcpy(retpath, args.name, len); (void)strlcpy(retpath, args.name, len);
strncat(retpath, "/", 1); (void)strlcat(retpath, "/", 1);
strncat(retpath, name, name_len); (void)strlcat(retpath, name, name_len);
} else { } else {
/* we're at the root of ref_tree */ /* we're at the root of ref_tree */
len = name_len + 1; len = name_len + 1;
...@@ -98,7 +102,7 @@ char *get_btrfs_subvol_path(int fd, u64 dir_id, u64 objid, char *name, ...@@ -98,7 +102,7 @@ char *get_btrfs_subvol_path(int fd, u64 dir_id, u64 objid, char *name,
if (!retpath) if (!retpath)
return NULL; return NULL;
*retpath = '\0'; *retpath = '\0';
strncat(retpath, name, name_len); (void)strlcat(retpath, name, name_len);
} }
return retpath; return retpath;
} }
......
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