Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/net lint clean



details:   https://anonhg.NetBSD.org/src/rev/abb41ecdb356
branches:  trunk
changeset: 535370:abb41ecdb356
user:      itojun <itojun%NetBSD.org@localhost>
date:      Fri Aug 16 12:20:19 2002 +0000

description:
lint clean

diffstat:

 lib/libc/net/inet_net_ntop.c |  19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diffs (74 lines):

diff -r d61e91ba3b4e -r abb41ecdb356 lib/libc/net/inet_net_ntop.c
--- a/lib/libc/net/inet_net_ntop.c      Fri Aug 16 12:18:06 2002 +0000
+++ b/lib/libc/net/inet_net_ntop.c      Fri Aug 16 12:20:19 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: inet_net_ntop.c,v 1.15 2002/08/16 12:18:06 itojun Exp $        */
+/*     $NetBSD: inet_net_ntop.c,v 1.16 2002/08/16 12:20:19 itojun Exp $        */
 
 /*
  * Copyright (c) 1996,1999 by Internet Software Consortium.
@@ -22,7 +22,7 @@
 #if 0
 static const char rcsid[] = "Id: inet_net_ntop.c,v 1.8 2001/09/27 15:08:36 marka Exp ";
 #else
-__RCSID("$NetBSD: inet_net_ntop.c,v 1.15 2002/08/16 12:18:06 itojun Exp $");
+__RCSID("$NetBSD: inet_net_ntop.c,v 1.16 2002/08/16 12:20:19 itojun Exp $");
 #endif
 #endif
 
@@ -117,7 +117,7 @@
        for (b = bits / 8; b > 0; b--) {
                if (ep - dst <= sizeof "255.")
                        goto emsgsize;
-               advance = snprintf(dst, ep - dst, "%u", *src++);
+               advance = snprintf(dst, (size_t)(ep - dst), "%u", *src++);
                if (advance <= 0 || advance >= ep - dst)
                        goto emsgsize;
                dst += advance;
@@ -140,7 +140,7 @@
                        *dst++ = '.';
                }
                m = ((1 << b) - 1) << (8 - b);
-               advance = snprintf(dst, ep - dst, "%u", *src & m);
+               advance = snprintf(dst, (size_t)(ep - dst), "%u", *src & m);
                if (advance <= 0 || advance >= ep - dst)
                        goto emsgsize;
                dst += advance;
@@ -149,7 +149,7 @@
        /* Format CIDR /width. */
        if (ep - dst <= sizeof "/32")
                goto emsgsize;
-       advance = snprintf(dst, ep - dst, "/%u", bits);
+       advance = snprintf(dst, (size_t)(ep - dst), "/%u", bits);
        if (advance <= 0 || advance >= ep - dst)
                goto emsgsize;
        dst += advance;
@@ -269,15 +269,16 @@
 
                        if (is_ipv4 && p > 5) {
                                *cp++ = (p == 6) ? ':' : '.';
-                               advance = snprintf(cp, ep - cp, "%u", *s++);
+                               advance = snprintf(cp, (size_t)(ep - cp),
+                                   "%u", *s++);
                                if (advance <= 0 || advance >= ep - cp)
                                        goto emsgsize;
                                cp += advance;
                                /* we can potentially drop the last octet */
                                if (p != 7 || bits > 120) {
                                        *cp++ = '.';
-                                       advance = snprintf(cp, ep - cp, "%u",
-                                           *s++);
+                                       advance = snprintf(cp,
+                                           (size_t)(ep - cp), "%u", *s++);
                                        if (advance <= 0 || advance >= ep - cp)
                                                goto emsgsize;
                                        cp += advance;
@@ -285,7 +286,7 @@
                        } else {
                                if (cp != outbuf)
                                        *cp++ = ':';
-                               advance = snprintf(cp, ep - cp, "%x",
+                               advance = snprintf(cp, (size_t)(ep - cp), "%x",
                                    *s * 256 + s[1]);
                                if (advance <= 0 || advance >= ep - cp)
                                        goto emsgsize;



Home | Main Index | Thread Index | Old Index