Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/net correct cases with zero in the middle



details:   https://anonhg.NetBSD.org/src/rev/3a9279947cd0
branches:  trunk
changeset: 535367:3a9279947cd0
user:      itojun <itojun%NetBSD.org@localhost>
date:      Fri Aug 16 12:05:01 2002 +0000

description:
correct cases with zero in the middle
(0x00ff00ff should be "0.255.0.255", not "255.255")

diffstat:

 lib/libc/net/inet_neta.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 1ea2a37b4bad -r 3a9279947cd0 lib/libc/net/inet_neta.c
--- a/lib/libc/net/inet_neta.c  Fri Aug 16 12:03:41 2002 +0000
+++ b/lib/libc/net/inet_neta.c  Fri Aug 16 12:05:01 2002 +0000
@@ -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 @@
                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);



Home | Main Index | Thread Index | Old Index