summaryrefslogtreecommitdiffstats
path: root/canfield
diff options
context:
space:
mode:
authordholland <dholland@NetBSD.org>2010-01-01 06:31:18 +0000
committerdholland <dholland@NetBSD.org>2010-01-01 06:31:18 +0000
commit935215e3fc8ec9628ca535a7d7eb50dfd7eed978 (patch)
tree8a98338d80dcb70f971797404cbb176adecddf90 /canfield
parentae5c11adb04540dcd3b80bbf03bb6bc0027bc1ec (diff)
downloadbsdgames-darwin-935215e3fc8ec9628ca535a7d7eb50dfd7eed978.tar.gz
bsdgames-darwin-935215e3fc8ec9628ca535a7d7eb50dfd7eed978.tar.zst
bsdgames-darwin-935215e3fc8ec9628ca535a7d7eb50dfd7eed978.zip
Use NULL instead of 0 for pointer tests. Remove an unnecessary cast.
Diffstat (limited to 'canfield')
-rw-r--r--canfield/cfscores/cfscores.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/canfield/cfscores/cfscores.c b/canfield/cfscores/cfscores.c
index d932ce84..54d57a14 100644
--- a/canfield/cfscores/cfscores.c
+++ b/canfield/cfscores/cfscores.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cfscores.c,v 1.18 2010/01/01 06:20:45 dholland Exp $ */
+/* $NetBSD: cfscores.c,v 1.19 2010/01/01 06:31:18 dholland Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1993\
#if 0
static char sccsid[] = "@(#)cfscores.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: cfscores.c,v 1.18 2010/01/01 06:20:45 dholland Exp $");
+__RCSID("$NetBSD: cfscores.c,v 1.19 2010/01/01 06:31:18 dholland Exp $");
#endif
#endif /* not lint */
@@ -87,19 +87,19 @@ main(int argc, char *argv[])
if (argc == 1) {
uid = getuid();
pw = getpwuid(uid);
- if (pw == 0) {
+ if (pw == NULL) {
errx(2, "You are not listed in the password file?!?");
}
printuser(pw, 1);
exit(0);
}
if (strcmp(argv[1], "-a") == 0) {
- while ((pw = getpwent()) != 0)
+ while ((pw = getpwent()) != NULL)
printuser(pw, 0);
exit(0);
}
pw = getpwnam(argv[1]);
- if (pw == 0) {
+ if (pw == NULL) {
errx(3, "User %s unknown", argv[1]);
}
printuser(pw, 1);
@@ -125,7 +125,7 @@ printuser(const struct passwd *pw, int printfail)
i = lseek(dbfd, pos, SEEK_SET);
if (i < 0)
warn("lseek %s", _PATH_SCORE);
- i = read(dbfd, (char *)&total, sizeof(total));
+ i = read(dbfd, &total, sizeof(total));
if (i < 0)
warn("read %s", _PATH_SCORE);
if (i == 0 || total.hand == 0) {