Source-Changes-HG archive

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

[src/netbsd-1-5]: src/lib/libc/net Pull up revision 1.17 (requested by groo):



details:   https://anonhg.NetBSD.org/src/rev/494b7f06786d
branches:  netbsd-1-5
changeset: 493066:494b7f06786d
user:      he <he%NetBSD.org@localhost>
date:      Wed Apr 17 12:00:56 2002 +0000

description:
Pull up revision 1.17 (requested by groo):
  Minor style adjustments, and do proper end of string detection
  in read_config_file().

diffstat:

 lib/libc/net/hesiod.c |  19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diffs (54 lines):

diff -r e8d787d17847 -r 494b7f06786d lib/libc/net/hesiod.c
--- a/lib/libc/net/hesiod.c     Wed Apr 17 11:59:26 2002 +0000
+++ b/lib/libc/net/hesiod.c     Wed Apr 17 12:00:56 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hesiod.c,v 1.13.2.3 2002/04/17 11:59:26 he Exp $       */
+/*     $NetBSD: hesiod.c,v 1.13.2.4 2002/04/17 12:00:56 he Exp $       */
 
 /* Copyright (c) 1996 by Internet Software Consortium.
  *
@@ -52,7 +52,7 @@
     "#Id: hesiod_p.h,v 1.1 1996/12/08 21:39:37 ghudson Exp #");
 __IDSTRING(rcsid_hescompat_c,
     "#Id: hescompat.c,v 1.1.2.1 1996/12/16 08:37:45 ghudson Exp #");
-__RCSID("$NetBSD: hesiod.c,v 1.13.2.3 2002/04/17 11:59:26 he Exp $");
+__RCSID("$NetBSD: hesiod.c,v 1.13.2.4 2002/04/17 12:00:56 he Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -254,7 +254,7 @@
 
                /* Make a copy of the result and return it to the caller. */
        ret = strdup(bindname);
-       if (!ret)
+       if (ret == NULL)
                errno = ENOMEM;
        return ret;
 }
@@ -351,15 +351,24 @@
                while (*p == ' ' || *p == '\t')
                        p++;
                key = p;
-               while (*p != ' ' && *p != '\t' && *p != '=')
+               while (*p != ' ' && *p != '\t' && *p != '=' && *p)
                        p++;
+
+               if (*p == '\0')
+                       continue;
+
                *p++ = 0;
 
                while (isspace((u_char) *p) || *p == '=')
                        p++;
+
+               if (*p == '\0')
+                       continue;
+
                data = p;
-               while (!isspace((u_char) *p))
+               while (!isspace((u_char) *p) && *p)
                        p++;
+
                *p = 0;
 
                if (strcasecmp(key, "lhs") == 0 ||



Home | Main Index | Thread Index | Old Index