summaryrefslogtreecommitdiffstats
path: root/pimd
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2019-06-03 16:09:22 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2019-06-03 16:09:22 +0200
commitfbd74c7d948e3c7ac1cd6e2510f4bec70ee17063 (patch)
treed064ab9be4201f89b48d2e4e319dc41433c5d9b5 /pimd
parentpimd: Remove unused functions (diff)
downloadfrr-fbd74c7d948e3c7ac1cd6e2510f4bec70ee17063.tar.xz
frr-fbd74c7d948e3c7ac1cd6e2510f4bec70ee17063.zip
pimd: Convert strncpy to strlcpy in pim_cmd.c
A couple of places of strncpy snuck in due to my confusion about if Quentin's earlier change had gotten in. Just some code in flux. This should fix the issue/warnings in our CI system.
Diffstat (limited to 'pimd')
-rw-r--r--pimd/pim_cmd.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c
index f3343f122..49862de79 100644
--- a/pimd/pim_cmd.c
+++ b/pimd/pim_cmd.c
@@ -3082,7 +3082,7 @@ static void pim_show_group_rp_mappings_info(struct pim_instance *pim,
json_object *json_row = NULL;
if (pim->global_scope.current_bsr.s_addr == INADDR_ANY)
- strncpy(bsr_str, "0.0.0.0", sizeof(bsr_str));
+ strlcpy(bsr_str, "0.0.0.0", sizeof(bsr_str));
else
pim_inet4_dump("<bsr?>", pim->global_scope.current_bsr, bsr_str,
@@ -3650,7 +3650,7 @@ static void pim_show_bsr(struct pim_instance *pim,
vty_out(vty, "PIMv2 Bootstrap information\n");
if (pim->global_scope.current_bsr.s_addr == INADDR_ANY) {
- strncpy(bsr_str, "0.0.0.0", sizeof(bsr_str));
+ strlcpy(bsr_str, "0.0.0.0", sizeof(bsr_str));
pim_time_uptime(uptime, sizeof(uptime),
pim->global_scope.current_bsr_first_ts);
pim_time_uptime(last_bsm_seen, sizeof(last_bsm_seen),
@@ -3669,16 +3669,16 @@ static void pim_show_bsr(struct pim_instance *pim,
switch (pim->global_scope.state) {
case NO_INFO:
- strncpy(bsr_state, "NO_INFO", sizeof(bsr_state));
+ strlcpy(bsr_state, "NO_INFO", sizeof(bsr_state));
break;
case ACCEPT_ANY:
- strncpy(bsr_state, "ACCEPT_ANY", sizeof(bsr_state));
+ strlcpy(bsr_state, "ACCEPT_ANY", sizeof(bsr_state));
break;
case ACCEPT_PREFERRED:
- strncpy(bsr_state, "ACCEPT_PREFERRED", sizeof(bsr_state));
+ strlcpy(bsr_state, "ACCEPT_PREFERRED", sizeof(bsr_state));
break;
default:
- strncpy(bsr_state, "", sizeof(bsr_state));
+ strlcpy(bsr_state, "", sizeof(bsr_state));
}
if (uj) {