From e9b61ea0fdba46cbdba99a08028ff9097f52803a Mon Sep 17 00:00:00 2001 From: Joerg Wunsch Date: Thu, 25 Nov 1999 15:57:54 +0000 Subject: Don't coredump if can't write to the scorefile. --- games/battlestar/com6.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'games') diff --git a/games/battlestar/com6.c b/games/battlestar/com6.c index ec01b111292af..a22b0fb7fa438 100644 --- a/games/battlestar/com6.c +++ b/games/battlestar/com6.c @@ -29,6 +29,8 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. + * + * $FreeBSD$ */ #ifndef lint @@ -105,7 +107,12 @@ char ch; struct timeval tv; char *date; time_t tvsec; - int s = sigblock(sigmask(SIGINT)); + int s; + + if (score_fp == NULL) + return; + + s = sigblock(sigmask(SIGINT)); gettimeofday(&tv, (struct timezone *)0); /* can't call time */ tvsec = (time_t) tv.tv_sec; -- cgit v1.3