(inet_ntop4): Take terminating '\0' into account in the size check.
authordrepper <drepper>
Mon, 30 Apr 2007 22:29:33 +0000 (22:29 +0000)
committerdrepper <drepper>
Mon, 30 Apr 2007 22:29:33 +0000 (22:29 +0000)
resolv/inet_ntop.c

index e5553a1..1222d08 100644 (file)
@@ -96,7 +96,7 @@ inet_ntop4(src, dst, size)
        static const char fmt[] = "%u.%u.%u.%u";
        char tmp[sizeof "255.255.255.255"];
 
-       if (SPRINTF((tmp, fmt, src[0], src[1], src[2], src[3])) > size) {
+       if (SPRINTF((tmp, fmt, src[0], src[1], src[2], src[3])) >= size) {
                __set_errno (ENOSPC);
                return (NULL);
        }