summaryrefslogtreecommitdiffstats
path: root/trek
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2006-03-19 01:00:35 +0000
committerchristos <christos@NetBSD.org>2006-03-19 01:00:35 +0000
commitcab3e1c5c6fefe9d3a264d409ef8933fbddc9744 (patch)
tree05cf6111f33eb0ba78eea6ebcd3e1744bceedc88 /trek
parentdf3a91296462d0a72da374c6faceb63be6657eee (diff)
downloadbsdgames-darwin-cab3e1c5c6fefe9d3a264d409ef8933fbddc9744.tar.gz
bsdgames-darwin-cab3e1c5c6fefe9d3a264d409ef8933fbddc9744.tar.zst
bsdgames-darwin-cab3e1c5c6fefe9d3a264d409ef8933fbddc9744.zip
Coverity CID 1197: Don't pass -1 to close.
Diffstat (limited to 'trek')
-rw-r--r--trek/dumpgame.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/trek/dumpgame.c b/trek/dumpgame.c
index 0e09e56c..e9c20120 100644
--- a/trek/dumpgame.c
+++ b/trek/dumpgame.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dumpgame.c,v 1.9 2004/01/27 20:30:31 jsm Exp $ */
+/* $NetBSD: dumpgame.c,v 1.10 2006/03/19 01:00:35 christos Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)dumpgame.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: dumpgame.c,v 1.9 2004/01/27 20:30:31 jsm Exp $");
+__RCSID("$NetBSD: dumpgame.c,v 1.10 2006/03/19 01:00:35 christos Exp $");
#endif
#endif /* not lint */
@@ -132,7 +132,8 @@ restartgame()
readdump(fd))
{
printf("cannot restart\n");
- close(fd);
+ if (fd >= 0)
+ close(fd);
return (1);
}