summaryrefslogtreecommitdiffstats
path: root/games/cribbage/score.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/score.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/score.c')
-rw-r--r--games/cribbage/score.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/games/cribbage/score.c b/games/cribbage/score.c
index 239e26d..ecfed9a 100644
--- a/games/cribbage/score.c
+++ b/games/cribbage/score.c
@@ -115,7 +115,7 @@ scorehand(hand, starter, n, crb, do_explain)
CARD h[(CINHAND + 1)];
char buf[32];
- expl[0] = NULL; /* initialize explanation */
+ expl[0] = '\0'; /* initialize explanation */
score = 0;
flag = TRUE;
k = hand[0].suit;
@@ -131,7 +131,7 @@ scorehand(hand, starter, n, crb, do_explain)
}
if (flag && n >= CINHAND) {
- if (do_explain && expl[0] != NULL)
+ if (do_explain && expl[0] != '\0')
strcat(expl, ", ");
if (starter.suit == k) {
score += 5;
@@ -140,13 +140,13 @@ scorehand(hand, starter, n, crb, do_explain)
} else
if (!crb) {
score += 4;
- if (do_explain && expl[0] != NULL)
+ if (do_explain && expl[0] != '\0')
strcat(expl, ", Four-flush");
else
strcpy(expl, "Four-flush");
}
}
- if (do_explain && expl[0] != NULL)
+ if (do_explain && expl[0] != '\0')
strcat(expl, ", ");
h[n] = starter;
sorthand(h, n + 1); /* sort by rank */
OpenPOWER on IntegriCloud