]> git.proxmox.com Git - mirror_lxc.git/commitdiff
btrfs: s/strncat()/strlcat()/g
authorChristian Brauner <christian.brauner@ubuntu.com>
Wed, 20 Jun 2018 15:53:19 +0000 (17:53 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Wed, 20 Jun 2018 15:53:37 +0000 (17:53 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/Makefile.am
src/lxc/storage/btrfs.c

index 99b5291d10ad3fea64d530ecbe0143c14b82ad30..313475824c52de736d2ad618fdb2facacb679eaf 100644 (file)
@@ -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
index 3458b1f65c1a1190d0afec73fb2161d8a02f62d6..c83ddf4e8194ebb303cc5c582f962b3a38011fd7 100644 (file)
 #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;
 }