From 22a27dede77166c7bdf1de647d4d2b961fcd92c2 Mon Sep 17 00:00:00 2001 From: hubertf Date: Wed, 10 Feb 1999 00:45:45 +0000 Subject: The game sail(6) has a function Write() which is used both with integer arguments and with string arguments (cast to long, and in one place to int). The patch here cleans this up, making it into two separate functions; this allows for the game to be made const-correct in future and improves portability. The patch also contains two other fragments: a change to use the symbolic constant SEEK_END with fseek(), and a change to use snprintf in one place to avoid a buffer overrun. Via PR 6569 by Joseph Myers . --- sail/dr_4.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sail/dr_4.c') diff --git a/sail/dr_4.c b/sail/dr_4.c index 4d786dcc..336bdcf5 100644 --- a/sail/dr_4.c +++ b/sail/dr_4.c @@ -1,4 +1,4 @@ -/* $NetBSD: dr_4.c,v 1.6 1997/10/13 21:03:37 christos Exp $ */ +/* $NetBSD: dr_4.c,v 1.7 1999/02/10 00:45:45 hubertf Exp $ */ /* * Copyright (c) 1983, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)dr_4.c 8.2 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: dr_4.c,v 1.6 1997/10/13 21:03:37 christos Exp $"); +__RCSID("$NetBSD: dr_4.c,v 1.7 1999/02/10 00:45:45 hubertf Exp $"); #endif #endif /* not lint */ @@ -69,7 +69,7 @@ struct ship *from, *to; { if (capship(from)->nationality != capship(to)->nationality && die() > 2) return; - Write(W_GRAP, from, 0, to->file->index, 0, 0, 0); - Write(W_GRAP, to, 0, from->file->index, 0, 0, 0); + Write(W_GRAP, from, to->file->index, 0, 0, 0); + Write(W_GRAP, to, from->file->index, 0, 0, 0); makesignal(from, "grappled with $$", to); } -- cgit v1.2.3