]> git.proxmox.com Git - mirror_lxc.git/commitdiff
confile: strncat => strlcat
authorDonghwa Jeong <dh48.jeong@samsung.com>
Thu, 21 Jun 2018 05:36:46 +0000 (14:36 +0900)
committerDonghwa Jeong <dh48.jeong@samsung.com>
Fri, 22 Jun 2018 05:14:13 +0000 (14:14 +0900)
Signed-off-by: Donghwa Jeong <dh48.jeong@samsung.com>
src/lxc/confile.c

index 593986510265993549d6209bef9485cb15acd906..a072901126c2560285a37947615b6a83861e0b31 100644 (file)
 #include "include/strlcpy.h"
 #endif
 
+#ifndef HAVE_STRLCAT
+#include "include/strlcat.h"
+#endif
+
 lxc_log_define(lxc_confile, lxc);
 
 #define lxc_config_define(name)                                                \
@@ -2061,10 +2065,10 @@ int append_unexp_config_line(const char *line, struct lxc_conf *conf)
                conf->unexpanded_alloced += 1024;
        }
 
-       strncat(conf->unexpanded_config, line, linelen);
+       (void)strlcat(conf->unexpanded_config, line, conf->unexpanded_alloced);
        conf->unexpanded_len += linelen;
        if (line[linelen - 1] != '\n') {
-               strncat(conf->unexpanded_config, "\n", 1);
+               (void)strlcat(conf->unexpanded_config, "\n", conf->unexpanded_alloced);
                conf->unexpanded_len++;
        }