From b58650d7c5df589d9819e4b7c4011a0e8c28dffd Mon Sep 17 00:00:00 2001 From: mikel Date: Thu, 10 Jul 1997 06:47:29 +0000 Subject: [PATCH] make explicit comparisons to NULL, s/rindex/strrchr/ --- games/cribbage/crib.c | 6 +++--- games/cribbage/instr.c | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/games/cribbage/crib.c b/games/cribbage/crib.c index 145083b2ac02..cf59d5aa1c84 100644 --- a/games/cribbage/crib.c +++ b/games/cribbage/crib.c @@ -1,4 +1,4 @@ -/* $NetBSD: crib.c,v 1.6 1997/07/09 06:25:45 phil Exp $ */ +/* $NetBSD: crib.c,v 1.7 1997/07/10 06:47:29 mikel Exp $ */ /*- * Copyright (c) 1980, 1993 @@ -43,7 +43,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)crib.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$NetBSD: crib.c,v 1.6 1997/07/09 06:25:45 phil Exp $"; +static char rcsid[] = "$NetBSD: crib.c,v 1.7 1997/07/10 06:47:29 mikel Exp $"; #endif #endif /* not lint */ @@ -126,7 +126,7 @@ main(argc, argv) playing = (getuchar() == 'Y'); } while (playing); - if (f = fopen(_PATH_LOG, "a")) { + if ((f = fopen(_PATH_LOG, "a")) != NULL) { (void)fprintf(f, "%s: won %5.5d, lost %5.5d\n", getlogin(), cgames, pgames); (void) fclose(f); diff --git a/games/cribbage/instr.c b/games/cribbage/instr.c index c2ab997a0b35..936302e0a5bc 100644 --- a/games/cribbage/instr.c +++ b/games/cribbage/instr.c @@ -1,4 +1,4 @@ -/* $NetBSD: instr.c,v 1.4 1996/02/06 22:47:18 jtc Exp $ */ +/* $NetBSD: instr.c,v 1.5 1997/07/10 06:47:30 mikel Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)instr.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$NetBSD: instr.c,v 1.4 1996/02/06 22:47:18 jtc Exp $"; +static char rcsid[] = "$NetBSD: instr.c,v 1.5 1997/07/10 06:47:30 mikel Exp $"; #endif #endif /* not lint */ @@ -76,10 +76,10 @@ instructions() case 0: if (!(path = getenv("PAGER"))) path = _PATH_MORE; - if (pager = rindex(path, '/')) + if ((pager = strrchr(path, '/')) != NULL) ++pager; pager = path; - execlp(path, pager, _PATH_INSTR, (char *)NULL); + execlp(path, pager, _PATH_INSTR, NULL); (void)fprintf(stderr, "cribbage: %s.\n", strerror(errno)); _exit(1); default: