]> git.cameronkatri.com Git - bsdgames-darwin.git/commitdiff
Coverity CID 1197: Don't pass -1 to close.
authorchristos <christos@NetBSD.org>
Sun, 19 Mar 2006 01:00:35 +0000 (01:00 +0000)
committerchristos <christos@NetBSD.org>
Sun, 19 Mar 2006 01:00:35 +0000 (01:00 +0000)
trek/dumpgame.c

index 0e09e56c6ae480a9fd609ad1b88f5e8d3429eb83..e9c2012044fb5576532d0959c431e8d762d58179 100644 (file)
@@ -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);
        }