From c83a77b4ec3b4473778b5ea0a5ae283fc4114a4c Mon Sep 17 00:00:00 2001 From: simonb Date: Thu, 30 Dec 1999 01:40:08 +0000 Subject: Don't use . 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()). --- monop/cards.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'monop/cards.c') 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 */ -- cgit v1.2.3-56-ge451