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

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