summaryrefslogtreecommitdiffstats
path: root/games/cribbage/io.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1997-09-18 13:45:34 +0000
committerphk <phk@FreeBSD.org>1997-09-18 13:45:34 +0000
commit2d831c7d21d4e39820d9fe862e7ec818476c083b (patch)
tree8fbe1264a5b4847d971add4433faa0f7cce9b35c /games/cribbage/io.c
parentbf06d52b9dd8b00f77a1fd5550c0d7ba459c8744 (diff)
downloadFreeBSD-src-2d831c7d21d4e39820d9fe862e7ec818476c083b.zip
FreeBSD-src-2d831c7d21d4e39820d9fe862e7ec818476c083b.tar.gz
Many places in the code NULL is used in integer context, where
plain 0 should be used. This happens to work because we #define NULL to 0, but is stylistically wrong and can cause problems for people trying to port bits of code to other environments. PR: 2752 Submitted by: Arne Henrik Juul <arnej@imf.unit.no>
Diffstat (limited to 'games/cribbage/io.c')
-rw-r--r--games/cribbage/io.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/games/cribbage/io.c b/games/cribbage/io.c
index c38c119..b4c2f15 100644
--- a/games/cribbage/io.c
+++ b/games/cribbage/io.c
@@ -250,10 +250,10 @@ incard(crd)
if (!(line = getline()))
goto gotit;
p = p1 = line;
- while (*p1 != ' ' && *p1 != NULL)
+ while (*p1 != ' ' && *p1 != '\0')
++p1;
- *p1++ = NULL;
- if (*p == NULL)
+ *p1++ = '\0';
+ if (*p == '\0')
goto gotit;
/* IMPORTANT: no real card has 2 char first name */
@@ -289,17 +289,17 @@ incard(crd)
if (rnk == EMPTY)
goto gotit;
p = p1;
- while (*p1 != ' ' && *p1 != NULL)
+ while (*p1 != ' ' && *p1 != '\0')
++p1;
- *p1++ = NULL;
- if (*p == NULL)
+ *p1++ = '\0';
+ if (*p == '\0')
goto gotit;
if (!strcmp("OF", p)) {
p = p1;
- while (*p1 != ' ' && *p1 != NULL)
+ while (*p1 != ' ' && *p1 != '\0')
++p1;
- *p1++ = NULL;
- if (*p == NULL)
+ *p1++ = '\0';
+ if (*p == '\0')
goto gotit;
}
sut = EMPTY;
@@ -348,7 +348,7 @@ number(lo, hi, prompt)
for (sum = 0;;) {
msg(prompt);
- if (!(p = getline()) || *p == NULL) {
+ if (!(p = getline()) || *p == '\0') {
msg(quiet ? "Not a number" :
"That doesn't look like a number");
continue;
@@ -363,7 +363,7 @@ number(lo, hi, prompt)
++p;
}
- if (*p != ' ' && *p != '\t' && *p != NULL)
+ if (*p != ' ' && *p != '\t' && *p != '\0')
sum = lo - 1;
if (sum >= lo && sum <= hi)
break;
OpenPOWER on IntegriCloud