From cab3e1c5c6fefe9d3a264d409ef8933fbddc9744 Mon Sep 17 00:00:00 2001 From: christos Date: Sun, 19 Mar 2006 01:00:35 +0000 Subject: Coverity CID 1197: Don't pass -1 to close. --- trek/dumpgame.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'trek') 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); } -- cgit v1.2.3-56-ge451