[lxc-devel] [lxc/master] tools: s/strncpy()/strlcpy()/g

brauner on Github lxc-bot at linuxcontainers.org
Fri May 11 13:29:46 UTC 2018


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 364 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20180511/502e266d/attachment.bin>
-------------- next part --------------
From 2ec47d5149e73db97f7877d06d67cb11421097bb Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at ubuntu.com>
Date: Fri, 11 May 2018 15:19:45 +0200
Subject: [PATCH] tools: s/strncpy()/strlcpy()/g

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
---
 src/lxc/Makefile.am         | 4 ++++
 src/lxc/tools/lxc_monitor.c | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/src/lxc/Makefile.am b/src/lxc/Makefile.am
index 923c43cab..ba4993cbd 100644
--- a/src/lxc/Makefile.am
+++ b/src/lxc/Makefile.am
@@ -290,6 +290,10 @@ if ENABLE_TOOLS
 if !HAVE_GETSUBOPT
 lxc_copy_SOURCES += tools/include/getsubopt.c tools/include/getsubopt.h
 endif
+
+if !HAVE_STRLCPY
+lxc_monitor_SOURCES += ../include/strlcpy.c ../include/strlcpy.h
+endif
 endif
 
 if ENABLE_COMMANDS
diff --git a/src/lxc/tools/lxc_monitor.c b/src/lxc/tools/lxc_monitor.c
index 050b5519b..ded6f1f38 100644
--- a/src/lxc/tools/lxc_monitor.c
+++ b/src/lxc/tools/lxc_monitor.c
@@ -47,6 +47,10 @@
 #include "arguments.h"
 #include "tool_utils.h"
 
+#ifndef HAVE_STRLCPY
+#include "include/strlcpy.h"
+#endif
+
 static bool quit_monitord;
 
 static int my_parser(struct lxc_arguments* args, int c, char* arg)


More information about the lxc-devel mailing list