From df5ec715c191abe50fec2da4dde393dab61244f1 Mon Sep 17 00:00:00 2001 From: dholland Date: Sun, 12 Jun 2016 02:15:26 +0000 Subject: Fix the out-of-memory behavior so the message doesn't disappear under endwin(). Related to PR 3126. --- gomoku/main.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'gomoku') diff --git a/gomoku/main.c b/gomoku/main.c index c0b1d5bc..4d9acb26 100644 --- a/gomoku/main.c +++ b/gomoku/main.c @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.26 2011/08/16 11:10:54 christos Exp $ */ +/* $NetBSD: main.c,v 1.27 2016/06/12 02:15:26 dholland Exp $ */ /* * Copyright (c) 1994 @@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1994\ #if 0 static char sccsid[] = "@(#)main.c 8.4 (Berkeley) 5/4/95"; #else -__RCSID("$NetBSD: main.c,v 1.26 2011/08/16 11:10:54 christos Exp $"); +__RCSID("$NetBSD: main.c,v 1.27 2016/06/12 02:15:26 dholland Exp $"); #endif #endif /* not lint */ @@ -562,12 +562,17 @@ panic(const char *fmt, ...) { va_list ap; + if (interactive) { + bdisp(); + cursfini(); + } + fprintf(stderr, "%s: ", prog); va_start(ap, fmt); vfprintf(stderr, fmt, ap); va_end(ap); fprintf(stderr, "\n"); - fputs("resign\n", stdout); - quit(); + fputs("I resign\n", stdout); + exit(1); } -- cgit v1.2.3