summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2019-05-08 20:33:53 +0200
committerQuentin Young <qlyoung@cumulusnetworks.com>2019-05-29 20:03:26 +0200
commitfcb072cdbfa87ffff0a5c94c29217a3235bbe8f3 (patch)
tree0d3c72feeeda933bddb93525dc09c82c53ca98ab /lib
parentzebra: strcat -> strlcat (diff)
downloadfrr-fcb072cdbfa87ffff0a5c94c29217a3235bbe8f3.tar.xz
frr-fcb072cdbfa87ffff0a5c94c29217a3235bbe8f3.zip
lib, zebra: remove uses of strncpy
This removes the last removable uses of strncpy in FRR. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/command_match.c4
-rw-r--r--lib/vty.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/command_match.c b/lib/command_match.c
index 8b34d1e3e..9456e1585 100644
--- a/lib/command_match.c
+++ b/lib/command_match.c
@@ -723,7 +723,7 @@ static enum match_type match_ipv4(const char *str)
if (str - sp > 3)
return no_match;
- strncpy(buf, sp, str - sp);
+ memcpy(buf, sp, str - sp);
if (atoi(buf) > 255)
return no_match;
@@ -774,7 +774,7 @@ static enum match_type match_ipv4_prefix(const char *str)
if (str - sp > 3)
return no_match;
- strncpy(buf, sp, str - sp);
+ memcpy(buf, sp, str - sp);
if (atoi(buf) > 255)
return no_match;
diff --git a/lib/vty.c b/lib/vty.c
index 91ba0a43c..9bee7b6c8 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -998,7 +998,7 @@ static void vty_describe_fold(struct vty *vty, int cmd_width,
if (pos == 0)
break;
- strncpy(buf, p, pos);
+ memcpy(buf, p, pos);
buf[pos] = '\0';
vty_out(vty, " %-*s %s\n", cmd_width, cmd, buf);