From ebcd5140b3c11cf7a3eab78495d80bcc11511b45 Mon Sep 17 00:00:00 2001 From: Donghwa Jeong Date: Thu, 21 Jun 2018 14:36:46 +0900 Subject: [PATCH] confile: strncat => strlcat Signed-off-by: Donghwa Jeong --- src/lxc/confile.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lxc/confile.c b/src/lxc/confile.c index 593986510..a07290112 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -69,6 +69,10 @@ #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++; } -- 2.47.2