confile: strncat => strlcat

parent bd583214
...@@ -69,6 +69,10 @@ ...@@ -69,6 +69,10 @@
#include "include/strlcpy.h" #include "include/strlcpy.h"
#endif #endif
#ifndef HAVE_STRLCAT
#include "include/strlcat.h"
#endif
lxc_log_define(lxc_confile, lxc); lxc_log_define(lxc_confile, lxc);
#define lxc_config_define(name) \ #define lxc_config_define(name) \
...@@ -2061,10 +2065,10 @@ int append_unexp_config_line(const char *line, struct lxc_conf *conf) ...@@ -2061,10 +2065,10 @@ int append_unexp_config_line(const char *line, struct lxc_conf *conf)
conf->unexpanded_alloced += 1024; conf->unexpanded_alloced += 1024;
} }
strncat(conf->unexpanded_config, line, linelen); (void)strlcat(conf->unexpanded_config, line, conf->unexpanded_alloced);
conf->unexpanded_len += linelen; conf->unexpanded_len += linelen;
if (line[linelen - 1] != '\n') { if (line[linelen - 1] != '\n') {
strncat(conf->unexpanded_config, "\n", 1); (void)strlcat(conf->unexpanded_config, "\n", conf->unexpanded_alloced);
conf->unexpanded_len++; conf->unexpanded_len++;
} }
......
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