correct cases with zero in the middle
(0x00ff00ff should be "0.255.0.255", not "255.255")
This commit is contained in:
parent
0b6566bcda
commit
b51bffa186
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: inet_neta.c,v 1.12 2002/08/16 12:03:41 itojun Exp $ */
|
||||
/* $NetBSD: inet_neta.c,v 1.13 2002/08/16 12:05:01 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996 by Internet Software Consortium.
|
||||
@ -22,7 +22,7 @@
|
||||
#if 0
|
||||
static const char rcsid[] = "Id: inet_neta.c,v 8.2 1996/08/08 06:54:44 vixie Exp ";
|
||||
#else
|
||||
__RCSID("$NetBSD: inet_neta.c,v 1.12 2002/08/16 12:03:41 itojun Exp $");
|
||||
__RCSID("$NetBSD: inet_neta.c,v 1.13 2002/08/16 12:05:01 itojun Exp $");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -75,7 +75,7 @@ inet_neta(src, dst, size)
|
||||
u_char b = (u_char)((src & 0xff000000) >> 24);
|
||||
|
||||
src <<= 8;
|
||||
if (b) {
|
||||
if (b || src) {
|
||||
if (ep - dst < sizeof "255.")
|
||||
goto emsgsize;
|
||||
advance = snprintf(dst, (size_t)(ep - dst), "%u", b);
|
||||
|
Loading…
Reference in New Issue
Block a user