summaryrefslogtreecommitdiffstats
path: root/gomoku/main.c
diff options
context:
space:
mode:
authordholland <dholland@NetBSD.org>2016-06-12 02:15:26 +0000
committerdholland <dholland@NetBSD.org>2016-06-12 02:15:26 +0000
commitdf5ec715c191abe50fec2da4dde393dab61244f1 (patch)
treeb33161e3aa2d29661435c1e77665bf476441e019 /gomoku/main.c
parentcb2f5d807c883948c7603f43b8caf4a038e5dd9c (diff)
downloadbsdgames-darwin-df5ec715c191abe50fec2da4dde393dab61244f1.tar.gz
bsdgames-darwin-df5ec715c191abe50fec2da4dde393dab61244f1.tar.zst
bsdgames-darwin-df5ec715c191abe50fec2da4dde393dab61244f1.zip
Fix the out-of-memory behavior so the message doesn't disappear under
endwin(). Related to PR 3126.
Diffstat (limited to 'gomoku/main.c')
-rw-r--r--gomoku/main.c13
1 files changed, 9 insertions, 4 deletions
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);
}