summaryrefslogtreecommitdiffstats
path: root/monop/cards.c
diff options
context:
space:
mode:
authorsimonb <simonb@NetBSD.org>1999-12-30 01:40:08 +0000
committersimonb <simonb@NetBSD.org>1999-12-30 01:40:08 +0000
commitc83a77b4ec3b4473778b5ea0a5ae283fc4114a4c (patch)
tree8af3f27332733d4ca47e3c1e6350baa3a5e8894f /monop/cards.c
parent73356fc8566dc0d1ed801778240a6b9bca36ba5e (diff)
downloadbsdgames-darwin-c83a77b4ec3b4473778b5ea0a5ae283fc4114a4c.tar.gz
bsdgames-darwin-c83a77b4ec3b4473778b5ea0a5ae283fc4114a4c.tar.zst
bsdgames-darwin-c83a77b4ec3b4473778b5ea0a5ae283fc4114a4c.zip
Don't use <err.h>. Use ANSI prototypes (no dependance on the __P()
macro). Add new fwrite_be_offt() function which writes out a big-endian 64bit number regards of the size of off_t on the host machine. Also fix ``bug'' in previous - even though the off_t pointers were stored big-endian, the individual card lenghs were in host-order. The cards.pck files are now identical when make on a big- or little-endian machine. Now builds a correct cards.pck file on non-NetBSD machines as well - tested on Ultrix and Solaris (but Solaris needs -lsocket to get htonl()).
Diffstat (limited to 'monop/cards.c')
-rw-r--r--monop/cards.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/monop/cards.c b/monop/cards.c
index 1b330db7..08551cc2 100644
--- a/monop/cards.c
+++ b/monop/cards.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cards.c,v 1.10 1999/09/09 17:27:58 jsm Exp $ */
+/* $NetBSD: cards.c,v 1.11 1999/12/30 01:40:08 simonb Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)cards.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: cards.c,v 1.10 1999/09/09 17:27:58 jsm Exp $");
+__RCSID("$NetBSD: cards.c,v 1.11 1999/12/30 01:40:08 simonb Exp $");
#endif
#endif /* not lint */
@@ -143,7 +143,7 @@ get_card(dp)
type_maj = getc(deckf);
} while (dp->gojf_used && type_maj == GOJF);
type_min = getc(deckf);
- num = getw(deckf);
+ num = ntohl(getw(deckf));
printmes();
switch (type_maj) {
case '+': /* get money */