Source-Changes-HG archive

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

[src/trunk]: src/lib/libcompat/4.3 - add a comparison to NULL in a conditional.



details:   https://anonhg.NetBSD.org/src/rev/f15dc10997e1
branches:  trunk
changeset: 472679:f15dc10997e1
user:      christos <christos%NetBSD.org@localhost>
date:      Tue May 04 17:12:21 1999 +0000

description:
- add a comparison to NULL in a conditional.
- cast third argument of strn*() to size_t
- s/FALL THROUGH/FALLTHROUGH/

diffstat:

 lib/libcompat/4.3/ruserpass.c |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (42 lines):

diff -r 0ec557ecf94b -r f15dc10997e1 lib/libcompat/4.3/ruserpass.c
--- a/lib/libcompat/4.3/ruserpass.c     Tue May 04 17:11:01 1999 +0000
+++ b/lib/libcompat/4.3/ruserpass.c     Tue May 04 17:12:21 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ruserpass.c,v 1.4 1998/08/19 00:17:41 thorpej Exp $    */
+/*     $NetBSD: ruserpass.c,v 1.5 1999/05/04 17:12:21 christos Exp $   */
 
 /*
  * Copyright (c) 1985, 1993, 1994
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)ruserpass.c        8.4 (Berkeley) 4/27/95";
 #else
-__RCSID("$NetBSD: ruserpass.c,v 1.4 1998/08/19 00:17:41 thorpej Exp $");
+__RCSID("$NetBSD: ruserpass.c,v 1.5 1999/05/04 17:12:21 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -124,11 +124,11 @@
        if ((mydomain = strchr(myname, '.')) == NULL)
                mydomain = "";
 next:
-       while ((t = token())) switch(t) {
+       while ((t = token()) != NULL) switch(t) {
 
        case DEFAULT:
                usedefault = 1;
-               /* FALL THROUGH */
+               /* FALLTHROUGH */
 
        case MACH:
                if (!usedefault) {
@@ -143,7 +143,8 @@
                                goto match;
                        if ((tmp = strchr(host, '.')) != NULL &&
                            strcasecmp(tmp, mydomain) == 0 &&
-                           strncasecmp(host, tokval, tmp - host) == 0 &&
+                           strncasecmp(host, tokval,
+                           (size_t)(tmp - host)) == 0 &&
                            tokval[tmp - host] == '\0')
                                goto match;
                        continue;



Home | Main Index | Thread Index | Old Index