Unverified Commit 9ab207ca by Stéphane Graber Committed by GitHub

Merge pull request #2318 from brauner/2018-05-11/compiler_fixes

tools: s/strncpy()/memcpy()/g
parents b717d3fa d96a9846
...@@ -290,10 +290,6 @@ if ENABLE_TOOLS ...@@ -290,10 +290,6 @@ if ENABLE_TOOLS
if !HAVE_GETSUBOPT if !HAVE_GETSUBOPT
lxc_copy_SOURCES += tools/include/getsubopt.c tools/include/getsubopt.h lxc_copy_SOURCES += tools/include/getsubopt.c tools/include/getsubopt.h
endif endif
if !HAVE_STRLCPY
lxc_monitor_SOURCES += ../include/strlcpy.c ../include/strlcpy.h
endif
endif endif
if ENABLE_COMMANDS if ENABLE_COMMANDS
......
...@@ -47,10 +47,6 @@ ...@@ -47,10 +47,6 @@
#include "arguments.h" #include "arguments.h"
#include "tool_utils.h" #include "tool_utils.h"
#ifndef HAVE_STRLCPY
#include "include/strlcpy.h"
#endif
static bool quit_monitord; static bool quit_monitord;
static int my_parser(struct lxc_arguments* args, int c, char* arg) static int my_parser(struct lxc_arguments* args, int c, char* arg)
...@@ -323,7 +319,7 @@ static int lxc_abstract_unix_connect(const char *path) ...@@ -323,7 +319,7 @@ static int lxc_abstract_unix_connect(const char *path)
return -1; return -1;
} }
/* addr.sun_path[0] has already been set to 0 by memset() */ /* addr.sun_path[0] has already been set to 0 by memset() */
strncpy(&addr.sun_path[1], &path[1], strlen(&path[1])); memcpy(&addr.sun_path[1], &path[1], strlen(&path[1]));
ret = connect(fd, (struct sockaddr *)&addr, ret = connect(fd, (struct sockaddr *)&addr,
offsetof(struct sockaddr_un, sun_path) + len + 1); offsetof(struct sockaddr_un, sun_path) + len + 1);
......
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