diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/src/util/ip_address.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/src/util/ip_address.c b/lib/src/util/ip_address.c index 8bbb2bf5d..49818de40 100644 --- a/lib/src/util/ip_address.c +++ b/lib/src/util/ip_address.c @@ -142,12 +142,12 @@ ip_address_snprintf(char * s, size_t size, const ip_address_t * ip_address, int const char * rc; switch(family) { case AF_INET: - if (size <= INET_ADDRSTRLEN) + if (size < INET_ADDRSTRLEN) return -1; rc = inet_ntop (AF_INET, ip_address->v4.buffer, s, INET_ADDRSTRLEN); break; case AF_INET6: - if (size <= INET6_ADDRSTRLEN) + if (size < INET6_ADDRSTRLEN) return -1; rc = inet_ntop (AF_INET6, ip_address->v6.buffer, s, INET6_ADDRSTRLEN); break; |