From ba40c8d63d5d3d1845ab52cf7a1065673f58d0b5 Mon Sep 17 00:00:00 2001 From: jsm Date: Fri, 17 Sep 1999 17:07:11 +0000 Subject: [PATCH] Fix some uses of NULL as non-pointer and 0 for null pointer. --- games/backgammon/backgammon/main.c | 6 +++--- games/boggle/boggle/bog.c | 6 +++--- games/quiz/quiz.c | 6 +++--- games/sail/game.c | 7 ++++--- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/games/backgammon/backgammon/main.c b/games/backgammon/backgammon/main.c index a08b29cbb026..0aab499d3d57 100644 --- a/games/backgammon/backgammon/main.c +++ b/games/backgammon/backgammon/main.c @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.14 1999/09/09 17:30:17 jsm Exp $ */ +/* $NetBSD: main.c,v 1.15 1999/09/17 17:07:11 jsm Exp $ */ /* * Copyright (c) 1980, 1993 @@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\ #if 0 static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: main.c,v 1.14 1999/09/09 17:30:17 jsm Exp $"); +__RCSID("$NetBSD: main.c,v 1.15 1999/09/17 17:07:11 jsm Exp $"); #endif #endif /* not lint */ @@ -120,7 +120,7 @@ main(argc, argv) /* use whole screen for text */ if (tflag) begscr = 0; - t = time(0); + t = time(NULL); srandom(t); /* 'random' seed */ #ifdef V7 diff --git a/games/boggle/boggle/bog.c b/games/boggle/boggle/bog.c index 6c3b92e2fae0..b4abde3bf333 100644 --- a/games/boggle/boggle/bog.c +++ b/games/boggle/boggle/bog.c @@ -1,4 +1,4 @@ -/* $NetBSD: bog.c,v 1.12 1999/09/08 21:17:44 jsm Exp $ */ +/* $NetBSD: bog.c,v 1.13 1999/09/17 17:07:11 jsm Exp $ */ /*- * Copyright (c) 1993 @@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1993\n\ #if 0 static char sccsid[] = "@(#)bog.c 8.2 (Berkeley) 5/4/95"; #else -__RCSID("$NetBSD: bog.c,v 1.12 1999/09/08 21:17:44 jsm Exp $"); +__RCSID("$NetBSD: bog.c,v 1.13 1999/09/17 17:07:11 jsm Exp $"); #endif #endif /* not lint */ @@ -604,7 +604,7 @@ checkdict() } mword[nmwords++] = mwordsp; p = w; - while ((*mwordsp++ = *p++) != NULL) + while ((*mwordsp++ = *p++) != '\0') ; } } diff --git a/games/quiz/quiz.c b/games/quiz/quiz.c index aec0ae788251..18b0f49d6f77 100644 --- a/games/quiz/quiz.c +++ b/games/quiz/quiz.c @@ -1,4 +1,4 @@ -/* $NetBSD: quiz.c,v 1.15 1999/09/12 09:02:22 jsm Exp $ */ +/* $NetBSD: quiz.c,v 1.16 1999/09/17 17:07:11 jsm Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -47,7 +47,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 1993\n\ #if 0 static char sccsid[] = "@(#)quiz.c 8.3 (Berkeley) 5/4/95"; #else -__RCSID("$NetBSD: quiz.c,v 1.15 1999/09/12 09:02:22 jsm Exp $"); +__RCSID("$NetBSD: quiz.c,v 1.16 1999/09/17 17:07:11 jsm Exp $"); #endif #endif /* not lint */ @@ -342,7 +342,7 @@ appdstr(s, tp, len) if ((m = malloc(strlen(s) + len + 1)) == NULL) errx(1, "malloc"); - for (mp = m, sp = s; (*mp++ = *sp++) != NULL; ) + for (mp = m, sp = s; (*mp++ = *sp++) != '\0'; ) ; --mp; if (*(mp - 1) == '\\') diff --git a/games/sail/game.c b/games/sail/game.c index 645c6a4d1d33..1b524dc57eaf 100644 --- a/games/sail/game.c +++ b/games/sail/game.c @@ -1,4 +1,4 @@ -/* $NetBSD: game.c,v 1.5 1997/10/13 19:44:09 christos Exp $ */ +/* $NetBSD: game.c,v 1.6 1999/09/17 17:07:11 jsm Exp $ */ /* * Copyright (c) 1983, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)game.c 8.2 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: game.c,v 1.5 1997/10/13 19:44:09 christos Exp $"); +__RCSID("$NetBSD: game.c,v 1.6 1999/09/17 17:07:11 jsm Exp $"); #endif #endif /* not lint */ @@ -52,7 +52,8 @@ char *af; int turns; turns = ship->specs->ta; - if ((*af = (ship->file->drift > 1 && turns)) != NULL) { + *af = (ship->file->drift > 1 && turns); + if (*af != '\0') { turns--; if (ship->file->FS == 1) turns = 0;