summaryrefslogtreecommitdiff
path: root/dhcpctl
diff options
context:
space:
mode:
authorMark Andrews <marka@isc.org>2013-05-15 10:49:54 +1000
committerMark Andrews <marka@isc.org>2013-05-15 10:49:54 +1000
commitdc9d7b08aa62743e7cbfb1795c324b3c1773ecd0 (patch)
tree5f15f5dc67d166c072f276867a0172071bcaff9f /dhcpctl
parent7133470475b841299f06487039be10003d020456 (diff)
downloadisc-dhcp-dc9d7b08aa62743e7cbfb1795c324b3c1773ecd0.tar.gz
- Silence benign static analysis warnings.
[ISC-Bugs #33428]
Diffstat (limited to 'dhcpctl')
-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)