diff options
| author | dholland <dholland@NetBSD.org> | 2008-01-28 01:58:01 +0000 |
|---|---|---|
| committer | dholland <dholland@NetBSD.org> | 2008-01-28 01:58:01 +0000 |
| commit | 928cdd4e3649aeb97d675a5babd680b668c9e24f (patch) | |
| tree | a58fcaeda0d48d6931b4bc060443444aee2093ca /sail/sync.c | |
| parent | 02b84b6eaa176512e869c83c44c5e07176b29785 (diff) | |
| download | bsdgames-darwin-928cdd4e3649aeb97d675a5babd680b668c9e24f.tar.gz bsdgames-darwin-928cdd4e3649aeb97d675a5babd680b668c9e24f.zip | |
Build with WARNS=4. Sort out the game's shadowing of its own variables,
which fixes at least one bug.
Diffstat (limited to 'sail/sync.c')
| -rw-r--r-- | sail/sync.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/sail/sync.c b/sail/sync.c index 757aa4d9..20ddfe9e 100644 --- a/sail/sync.c +++ b/sail/sync.c @@ -1,4 +1,4 @@ -/* $NetBSD: sync.c,v 1.24 2006/05/18 18:42:59 mrg Exp $ */ +/* $NetBSD: sync.c,v 1.25 2008/01/28 01:58:01 dholland Exp $ */ /* * Copyright (c) 1983, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)sync.c 8.2 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: sync.c,v 1.24 2006/05/18 18:42:59 mrg Exp $"); +__RCSID("$NetBSD: sync.c,v 1.25 2008/01/28 01:58:01 dholland Exp $"); #endif #endif /* not lint */ @@ -118,13 +118,13 @@ makemsg(struct ship *from, const char *fmt, ...) } int -sync_exists(int game) +sync_exists(int gamenum) { char buf[sizeof sync_file]; struct stat s; time_t t; - sprintf(buf, SF, game); + sprintf(buf, SF, gamenum); time(&t); setegid(egid); if (stat(buf, &s) < 0) { @@ -133,7 +133,7 @@ sync_exists(int game) } if (s.st_mtime < t - 60*60*2) { /* 2 hours */ unlink(buf); - sprintf(buf, LF, game); + sprintf(buf, LF, gamenum); unlink(buf); setegid(gid); return 0; @@ -166,11 +166,11 @@ sync_open(void) } void -sync_close(int remove) +sync_close(int doremove) { if (sync_fp != 0) fclose(sync_fp); - if (remove) { + if (doremove) { setegid(egid); unlink(sync_file); setegid(gid); @@ -251,13 +251,13 @@ Sync(void) if (isstr != 0 && isstr != 1) goto bad; if (isstr) { - int c; + int ch; char *p; for (p = buf;;) { - c = getc(sync_fp); - *p++ = (char)c; - switch (c) { + ch = getc(sync_fp); + *p++ = (char)ch; + switch (ch) { case '\n': p--; case EOF: |
