summaryrefslogtreecommitdiff
path: root/dhcpctl/omshell.c
diff options
context:
space:
mode:
Diffstat (limited to 'dhcpctl/omshell.c')
-rw-r--r--dhcpctl/omshell.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/dhcpctl/omshell.c b/dhcpctl/omshell.c
index bb489d84..22506eec 100644
--- a/dhcpctl/omshell.c
+++ b/dhcpctl/omshell.c
@@ -3,7 +3,7 @@
Examine and modify omapi objects. */
/*
- * Copyright (c) 2009-2011 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2009-2011,2013 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2004-2007 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2001-2003 by Internet Software Consortium
*
@@ -466,8 +466,12 @@ main(int argc, char **argv) {
break;
}
- s1[0] = '\0';
- strncat (s1, val, sizeof(s1)-1);
+#ifdef HAVE_STRLCPY
+ strlcpy (s1, val, sizeof(s1));
+#else
+ s1[0] = 0;
+ strncat (s1, val, sizeof(s1)-strlen(s1)-1);
+#endif
token = next_token (&val, (unsigned *)0, cfile);
if (token != EQUAL)
@@ -570,8 +574,12 @@ main(int argc, char **argv) {
break;
}
- s1[0] = '\0';
- strncat (s1, val, sizeof(s1)-1);
+#if HAVE_STRLCPY
+ strlcpy (s1, val, sizeof(s1));
+#else
+ s1[0] = 0;
+ strncat (s1, val, sizeof(s1)-strlen(s1)-1);
+#endif
token = next_token (&val, (unsigned *)0, cfile);
if (token != END_OF_FILE && token != EOL)