summaryrefslogtreecommitdiff
path: root/lib/prefix.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/prefix.c')
-rw-r--r--lib/prefix.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/prefix.c b/lib/prefix.c
index 43331d1552..5f188f09f9 100644
--- a/lib/prefix.c
+++ b/lib/prefix.c
@@ -770,10 +770,11 @@ const char *
prefix2str (union prefix46constptr pu, char *str, int size)
{
const struct prefix *p = pu.p;
- char buf[BUFSIZ];
+ char buf[PREFIX2STR_BUFFER];
- inet_ntop (p->family, &p->u.prefix, buf, BUFSIZ);
- snprintf (str, size, "%s/%d", buf, p->prefixlen);
+ snprintf (str, size, "%s/%d",
+ inet_ntop (p->family, &p->u.prefix, buf, PREFIX2STR_BUFFER),
+ p->prefixlen);
return str;
}