Module Name: src Committed By: dholland Date: Fri Jan 1 06:31:18 UTC 2010
Modified Files: src/games/canfield/cfscores: cfscores.c Log Message: Use NULL instead of 0 for pointer tests. Remove an unnecessary cast. To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/games/canfield/cfscores/cfscores.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/games/canfield/cfscores/cfscores.c diff -u src/games/canfield/cfscores/cfscores.c:1.18 src/games/canfield/cfscores/cfscores.c:1.19 --- src/games/canfield/cfscores/cfscores.c:1.18 Fri Jan 1 06:20:45 2010 +++ src/games/canfield/cfscores/cfscores.c Fri Jan 1 06:31:18 2010 @@ -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 @@ #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 @@ 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 @@ 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) {