Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/net sync with BIND 4.9.7. correct boundary checkin...



details:   https://anonhg.NetBSD.org/src/rev/47c9595ffc44
branches:  trunk
changeset: 485337:47c9595ffc44
user:      itojun <itojun%NetBSD.org@localhost>
date:      Tue Apr 25 13:27:22 2000 +0000

description:
sync with BIND 4.9.7.  correct boundary checking broken by delint mistake
(auto increment evaluation order).  costmetic changes.

diffstat:

 lib/libc/net/res_query.c |  38 +++++++++++++++++++-------------------
 1 files changed, 19 insertions(+), 19 deletions(-)

diffs (73 lines):

diff -r 0ef027c50453 -r 47c9595ffc44 lib/libc/net/res_query.c
--- a/lib/libc/net/res_query.c  Tue Apr 25 13:26:03 2000 +0000
+++ b/lib/libc/net/res_query.c  Tue Apr 25 13:27:22 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: res_query.c,v 1.25 2000/01/22 22:19:16 mycroft Exp $   */
+/*     $NetBSD: res_query.c,v 1.26 2000/04/25 13:27:22 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.25 2000/01/22 22:19:16 mycroft Exp $");
+__RCSID("$NetBSD: res_query.c,v 1.26 2000/04/25 13:27:22 itojun Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -156,21 +156,21 @@
                            ntohs(hp->ancount));
 #endif
                switch (hp->rcode) {
-                       case NXDOMAIN:
-                               h_errno = HOST_NOT_FOUND;
-                               break;
-                       case SERVFAIL:
-                               h_errno = TRY_AGAIN;
-                               break;
-                       case NOERROR:
-                               h_errno = NO_DATA;
-                               break;
-                       case FORMERR:
-                       case NOTIMP:
-                       case REFUSED:
-                       default:
-                               h_errno = NO_RECOVERY;
-                               break;
+               case NXDOMAIN:
+                       h_errno = HOST_NOT_FOUND;
+                       break;
+               case SERVFAIL:
+                       h_errno = TRY_AGAIN;
+                       break;
+               case NOERROR:
+                       h_errno = NO_DATA;
+                       break;
+               case FORMERR:
+               case NOTIMP:
+               case REFUSED:
+               default:
+                       h_errno = NO_RECOVERY;
+                       break;
                }
                return (-1);
        }
@@ -292,7 +292,7 @@
                         * we only wanted one iteration of the loop, so stop.
                         */
                        if (!(_res.options & RES_DNSRCH))
-                               done++;
+                               done++;
                }
        }
 
@@ -362,7 +362,7 @@
                        h_errno = NO_RECOVERY;
                        return (-1);
                }
-               if (n-- != 0 && name[n] == '.') {
+               if (n > 0 && name[--n] == '.') {
                        strncpy(nbuf, name, n);
                        nbuf[n] = '\0';
                } else



Home | Main Index | Thread Index | Old Index