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 %d/%u mixup.



details:   https://anonhg.NetBSD.org/src/rev/b408bb7e9791
branches:  trunk
changeset: 533311:b408bb7e9791
user:      itojun <itojun%NetBSD.org@localhost>
date:      Thu Jun 27 10:22:07 2002 +0000

description:
correct %d/%u mixup.

diffstat:

 lib/libc/net/getaddrinfo.c |   6 +++---
 lib/libc/net/getnameinfo.c |  12 ++++++------
 lib/libc/net/res_debug.c   |  22 +++++++++++-----------
 lib/libc/net/res_init.c    |   8 ++++----
 lib/libc/net/res_query.c   |   6 +++---
 lib/libc/net/rthdr.c       |  24 ++++++++++++------------
 6 files changed, 39 insertions(+), 39 deletions(-)

diffs (truncated from 323 to 300 lines):

diff -r 58ca26bc0e82 -r b408bb7e9791 lib/libc/net/getaddrinfo.c
--- a/lib/libc/net/getaddrinfo.c        Thu Jun 27 09:52:53 2002 +0000
+++ b/lib/libc/net/getaddrinfo.c        Thu Jun 27 10:22:07 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: getaddrinfo.c,v 1.56 2002/06/26 06:00:26 itojun Exp $  */
+/*     $NetBSD: getaddrinfo.c,v 1.57 2002/06/27 10:22:07 itojun Exp $  */
 /*     $KAME: getaddrinfo.c,v 1.29 2000/08/31 17:26:57 itojun Exp $    */
 
 /*
@@ -79,7 +79,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: getaddrinfo.c,v 1.56 2002/06/26 06:00:26 itojun Exp $");
+__RCSID("$NetBSD: getaddrinfo.c,v 1.57 2002/06/27 10:22:07 itojun Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -1731,7 +1731,7 @@
                        rcode = hp->rcode;      /* record most recent error */
 #ifdef DEBUG
                        if (_res.options & RES_DEBUG)
-                               printf(";; rcode = %d, ancount=%d\n", hp->rcode,
+                               printf(";; rcode = %u, ancount=%u\n", hp->rcode,
                                    ntohs(hp->ancount));
 #endif
                        continue;
diff -r 58ca26bc0e82 -r b408bb7e9791 lib/libc/net/getnameinfo.c
--- a/lib/libc/net/getnameinfo.c        Thu Jun 27 09:52:53 2002 +0000
+++ b/lib/libc/net/getnameinfo.c        Thu Jun 27 10:22:07 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: getnameinfo.c,v 1.39 2002/05/22 09:42:39 kleink Exp $  */
+/*     $NetBSD: getnameinfo.c,v 1.40 2002/06/27 10:22:09 itojun Exp $  */
 /*     $KAME: getnameinfo.c,v 1.45 2000/09/25 22:43:56 itojun Exp $    */
 
 /*
@@ -47,7 +47,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: getnameinfo.c,v 1.39 2002/05/22 09:42:39 kleink Exp $");
+__RCSID("$NetBSD: getnameinfo.c,v 1.40 2002/06/27 10:22:09 itojun Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -202,7 +202,7 @@
                                return EAI_MEMORY;
                        strlcpy(serv, sp->s_name, servlen);
                } else {
-                       snprintf(numserv, sizeof(numserv), "%d", ntohs(port));
+                       snprintf(numserv, sizeof(numserv), "%u", ntohs(port));
                        if (strlen(numserv) + 1 > servlen)
                                return EAI_MEMORY;
                        strlcpy(serv, numserv, servlen);
@@ -441,7 +441,7 @@
                *serv = '\0';
 
        if (sdl->sdl_nlen == 0 && sdl->sdl_alen == 0 && sdl->sdl_slen == 0) {
-               n = snprintf(host, hostlen, "link#%d", sdl->sdl_index);
+               n = snprintf(host, hostlen, "link#%u", sdl->sdl_index);
                if (n > hostlen) {
                        *host = '\0';
                        return EAI_MEMORY;
@@ -455,9 +455,9 @@
                if (sdl->sdl_alen < 2)
                        return EAI_FAMILY;
                if (LLADDR(sdl)[1] == 0)
-                       n = snprintf(host, hostlen, "%d", LLADDR(sdl)[0]);
+                       n = snprintf(host, hostlen, "%u", LLADDR(sdl)[0]);
                else
-                       n = snprintf(host, hostlen, "%d.%d",
+                       n = snprintf(host, hostlen, "%u.%u",
                            LLADDR(sdl)[1], LLADDR(sdl)[0]);
                if (n >= hostlen) {
                        *host = '\0';
diff -r 58ca26bc0e82 -r b408bb7e9791 lib/libc/net/res_debug.c
--- a/lib/libc/net/res_debug.c  Thu Jun 27 09:52:53 2002 +0000
+++ b/lib/libc/net/res_debug.c  Thu Jun 27 10:22:07 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: res_debug.c,v 1.31 2002/04/16 19:17:17 groo Exp $      */
+/*     $NetBSD: res_debug.c,v 1.32 2002/06/27 10:22:10 itojun Exp $    */
 
 /*-
  * Copyright (c) 1985, 1990, 1993
@@ -81,7 +81,7 @@
 static char sccsid[] = "@(#)res_debug.c        8.1 (Berkeley) 6/4/93";
 static char rcsid[] = "Id: res_debug.c,v 8.20 1997/06/01 20:34:37 vixie Exp ";
 #else
-__RCSID("$NetBSD: res_debug.c,v 1.31 2002/04/16 19:17:17 groo Exp $");
+__RCSID("$NetBSD: res_debug.c,v 1.32 2002/06/27 10:22:10 itojun Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -303,7 +303,7 @@
        cp = msg + HFIXEDSZ;
        endMark = msg + len;
        if ((!_res.pfcode) || (_res.pfcode & RES_PRF_HEADX) || hp->rcode) {
-               fprintf(file, ";; ->>HEADER<<- opcode: %s, status: %s, id: %d",
+               fprintf(file, ";; ->>HEADER<<- opcode: %s, status: %s, id: %u",
                        _res_opcodes[hp->opcode],
                        _res_resultcodes[hp->rcode],
                        ntohs(hp->id));
@@ -331,10 +331,10 @@
                        fprintf(file, " cd");
        }
        if ((!_res.pfcode) || (_res.pfcode & RES_PRF_HEAD1)) {
-               fprintf(file, "; Ques: %d", ntohs(hp->qdcount));
-               fprintf(file, ", Ans: %d", ntohs(hp->ancount));
-               fprintf(file, ", Auth: %d", ntohs(hp->nscount));
-               fprintf(file, ", Addit: %d", ntohs(hp->arcount));
+               fprintf(file, "; Ques: %u", ntohs(hp->qdcount));
+               fprintf(file, ", Ans: %u", ntohs(hp->ancount));
+               fprintf(file, ", Auth: %u", ntohs(hp->nscount));
+               fprintf(file, ", Addit: %u", ntohs(hp->arcount));
        }
        if ((!_res.pfcode) || (_res.pfcode & 
                (RES_PRF_HEADX | RES_PRF_HEAD2 | RES_PRF_HEAD1))) {
@@ -571,7 +571,7 @@
                                cp += sizeof(u_char);
                                port = _getshort(cp);
                                cp += sizeof(u_int16_t);
-                               fprintf(file, "\t%s\t; proto %d, port %d",
+                               fprintf(file, "\t%s\t; proto %u, port %u",
                                        address, protocol, port);
                        }
                        break;
@@ -643,14 +643,14 @@
        case T_MX:
        case T_AFSDB:
        case T_RT:
-               fprintf(file, "\t%d ", _getshort(cp));
+               fprintf(file, "\t%u ", _getshort(cp));
                cp += INT16SZ;
                if ((cp = p_fqname(cp, msg, file)) == NULL)
                        return (NULL);
                break;
 
        case T_PX:
-               fprintf(file, "\t%d ", _getshort(cp));
+               fprintf(file, "\t%u ", _getshort(cp));
                cp += INT16SZ;
                if ((cp = p_fqname(cp, msg, file)) == NULL)
                        return (NULL);
@@ -826,7 +826,7 @@
                type = _getshort((const u_char *)cp);
                cp += INT16SZ;
                fprintf(file, " %s", p_type(type));
-               fprintf(file, "\t%d", *cp++);   /* algorithm */
+               fprintf(file, "\t%u", *cp++);   /* algorithm */
                /* Check label value and print error if wrong. */
                n = *cp++;
                c = dn_count_labels (rrname);
diff -r 58ca26bc0e82 -r b408bb7e9791 lib/libc/net/res_init.c
--- a/lib/libc/net/res_init.c   Thu Jun 27 09:52:53 2002 +0000
+++ b/lib/libc/net/res_init.c   Thu Jun 27 10:22:07 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: res_init.c,v 1.37 2001/09/13 11:05:02 itojun Exp $     */
+/*     $NetBSD: res_init.c,v 1.38 2002/06/27 10:22:11 itojun Exp $     */
 
 /*-
  * Copyright (c) 1985, 1989, 1993
@@ -59,7 +59,7 @@
 static char sccsid[] = "@(#)res_init.c 8.1 (Berkeley) 6/7/93";
 static char rcsid[] = "Id: res_init.c,v 8.8 1997/06/01 20:34:37 vixie Exp ";
 #else
-__RCSID("$NetBSD: res_init.c,v 1.37 2001/09/13 11:05:02 itojun Exp $");
+__RCSID("$NetBSD: res_init.c,v 1.38 2002/06/27 10:22:11 itojun Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -330,7 +330,7 @@
                    hints.ai_family = PF_UNSPEC;
                    hints.ai_socktype = SOCK_DGRAM;
                    hints.ai_flags = AI_NUMERICHOST;
-                   snprintf(pbuf, sizeof(pbuf), "%d", NAMESERVER_PORT);
+                   snprintf(pbuf, sizeof(pbuf), "%u", NAMESERVER_PORT);
                    res = NULL;
                    if (getaddrinfo(cp, pbuf, &hints, &res) == 0 &&
                        minsiz >= res->ai_addrlen) {
@@ -540,7 +540,7 @@
                                _res.ndots = RES_MAXNDOTS;
 #ifdef DEBUG
                        if (_res.options & RES_DEBUG)
-                               printf(";;\tndots=%d\n", _res.ndots);
+                               printf(";;\tndots=%u\n", _res.ndots);
 #endif
                } else if (!strncmp(cp, "debug", sizeof("debug") - 1)) {
 #ifdef DEBUG
diff -r 58ca26bc0e82 -r b408bb7e9791 lib/libc/net/res_query.c
--- a/lib/libc/net/res_query.c  Thu Jun 27 09:52:53 2002 +0000
+++ b/lib/libc/net/res_query.c  Thu Jun 27 10:22:07 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: res_query.c,v 1.32 2000/12/20 20:51:08 christos Exp $  */
+/*     $NetBSD: res_query.c,v 1.33 2002/06/27 10:22:12 itojun Exp $    */
 
 /*-
  * Copyright (c) 1988, 1993
@@ -59,7 +59,7 @@
 static char sccsid[] = "@(#)res_query.c        8.1 (Berkeley) 6/4/93";
 static char rcsid[] = "Id: res_query.c,v 8.10 1997/06/01 20:34:37 vixie Exp ";
 #else
-__RCSID("$NetBSD: res_query.c,v 1.32 2000/12/20 20:51:08 christos Exp $");
+__RCSID("$NetBSD: res_query.c,v 1.33 2002/06/27 10:22:12 itojun Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -156,7 +156,7 @@
        if (hp->rcode != NOERROR || ntohs(hp->ancount) == 0) {
 #ifdef DEBUG
                if (_res.options & RES_DEBUG)
-                       printf(";; rcode = %d, ancount=%d\n", hp->rcode,
+                       printf(";; rcode = %u, ancount=%u\n", hp->rcode,
                            ntohs(hp->ancount));
 #endif
                switch (hp->rcode) {
diff -r 58ca26bc0e82 -r b408bb7e9791 lib/libc/net/rthdr.c
--- a/lib/libc/net/rthdr.c      Thu Jun 27 09:52:53 2002 +0000
+++ b/lib/libc/net/rthdr.c      Thu Jun 27 10:22:07 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rthdr.c,v 1.11 2001/11/04 13:57:30 lukem Exp $ */
+/*     $NetBSD: rthdr.c,v 1.12 2002/06/27 10:22:12 itojun Exp $        */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: rthdr.c,v 1.11 2001/11/04 13:57:30 lukem Exp $");
+__RCSID("$NetBSD: rthdr.c,v 1.12 2002/06/27 10:22:12 itojun Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -123,7 +123,7 @@
         struct ip6_rthdr0 *rt0 = (struct ip6_rthdr0 *)(void *)rthdr;
         if (flags != IPV6_RTHDR_LOOSE && flags != IPV6_RTHDR_STRICT) {
 #ifdef DEBUG
-            fprintf(stderr, "inet6_rthdr_add: unsupported flag(%d)\n", flags);
+            fprintf(stderr, "inet6_rthdr_add: unsupported flag(%u)\n", flags);
 #endif 
             return(-1);
         }
@@ -148,7 +148,7 @@
      }
      default:
 #ifdef DEBUG
-        fprintf(stderr, "inet6_rthdr_add: unknown type(%d)\n",
+        fprintf(stderr, "inet6_rthdr_add: unknown type(%u)\n",
                 rthdr->ip6r_type);
 #endif 
         return(-1);
@@ -174,7 +174,7 @@
         struct ip6_rthdr0 *rt0 = (struct ip6_rthdr0 *)(void *)rthdr;
         if (flags != IPV6_RTHDR_LOOSE && flags != IPV6_RTHDR_STRICT) {
 #ifdef DEBUG
-            fprintf(stderr, "inet6_rthdr_lasthop: unsupported flag(%d)\n", flags);
+            fprintf(stderr, "inet6_rthdr_lasthop: unsupported flag(%u)\n", flags);
 #endif 
             return(-1);
         }
@@ -194,7 +194,7 @@
      }
      default:
 #ifdef DEBUG
-        fprintf(stderr, "inet6_rthdr_lasthop: unknown type(%d)\n",
+        fprintf(stderr, "inet6_rthdr_lasthop: unknown type(%u)\n",
                 rthdr->ip6r_type);
 #endif 
         return(-1);
@@ -235,7 +235,7 @@
 
        if (rt0->ip6r0_len % 2 || 46 < rt0->ip6r0_len) {
 #ifdef DEBUG
-           fprintf(stderr, "inet6_rthdr_segments: invalid size(%d)\n",
+           fprintf(stderr, "inet6_rthdr_segments: invalid size(%u)\n",
                rt0->ip6r0_len);
 #endif 
            return -1;
@@ -246,7 +246,7 @@
 
     default:
 #ifdef DEBUG
-       fprintf(stderr, "inet6_rthdr_segments: unknown type(%d)\n",
+       fprintf(stderr, "inet6_rthdr_segments: unknown type(%u)\n",
            rthdr->ip6r_type);
 #endif 
        return -1;
@@ -272,7 +272,7 @@
 
        if (rt0->ip6r0_len % 2 || 46 < rt0->ip6r0_len) {
 #ifdef DEBUG
-           fprintf(stderr, "inet6_rthdr_getaddr: invalid size(%d)\n",
+           fprintf(stderr, "inet6_rthdr_getaddr: invalid size(%u)\n",
                rt0->ip6r0_len);
 #endif 
            return NULL;
@@ -289,7 +289,7 @@
 
     default:
 #ifdef DEBUG



Home | Main Index | Thread Index | Old Index