diff options
Diffstat (limited to 'lib/src/util/ip_address.c')
-rw-r--r-- | lib/src/util/ip_address.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/src/util/ip_address.c b/lib/src/util/ip_address.c index d4b34dc0b..1d123d8cd 100644 --- a/lib/src/util/ip_address.c +++ b/lib/src/util/ip_address.c @@ -302,7 +302,10 @@ ip_prefix_ntop(const ip_prefix_t * ip_prefix, char *dst, size_t size) } if (!s) return -1; - return snprintf(dst, size, "%s/%d", ip_s, ip_prefix->len); + int rc = snprintf(dst, size, "%s/%d", ip_s, ip_prefix->len); + if (rc >= size) + return (int)size; + return rc; } int |