summaryrefslogtreecommitdiffstats
path: root/ospf6d/ospf6_abr.c
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2021-02-23 21:55:02 +0100
committerGitHub <noreply@github.com>2021-02-23 21:55:02 +0100
commit15869cd81d346b5ebfcd2540012d7cb599729bd5 (patch)
tree909cea87cf6af4eaab9251a92513d8a1a22746f6 /ospf6d/ospf6_abr.c
parentMerge pull request #8095 from idryzhov/fix-nb-stale-pointers (diff)
parent*: remove more sprintf() (diff)
downloadfrr-15869cd81d346b5ebfcd2540012d7cb599729bd5.tar.xz
frr-15869cd81d346b5ebfcd2540012d7cb599729bd5.zip
Merge pull request #8035 from qlyoung/remove-more-sprintf
*: remove more sprintf()
Diffstat (limited to 'ospf6d/ospf6_abr.c')
-rw-r--r--ospf6d/ospf6_abr.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ospf6d/ospf6_abr.c b/ospf6d/ospf6_abr.c
index abcdb4054..f6a246500 100644
--- a/ospf6d/ospf6_abr.c
+++ b/ospf6d/ospf6_abr.c
@@ -1292,6 +1292,7 @@ static char *ospf6_inter_area_prefix_lsa_get_prefix_str(struct ospf6_lsa *lsa,
{
struct ospf6_inter_prefix_lsa *prefix_lsa;
struct in6_addr in6;
+ char tbuf[16];
if (lsa != NULL) {
prefix_lsa =
@@ -1301,8 +1302,9 @@ static char *ospf6_inter_area_prefix_lsa_get_prefix_str(struct ospf6_lsa *lsa,
ospf6_prefix_in6_addr(&in6, prefix_lsa, &prefix_lsa->prefix);
if (buf) {
inet_ntop(AF_INET6, &in6, buf, buflen);
- sprintf(&buf[strlen(buf)], "/%d",
- prefix_lsa->prefix.prefix_length);
+ snprintf(tbuf, sizeof(tbuf), "/%d",
+ prefix_lsa->prefix.prefix_length);
+ strlcat(buf, tbuf, buflen);
}
}