Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/games/gomoku Fix the out-of-memory behavior so the message d...



details:   https://anonhg.NetBSD.org/src/rev/8b52a28be777
branches:  trunk
changeset: 345865:8b52a28be777
user:      dholland <dholland%NetBSD.org@localhost>
date:      Sun Jun 12 02:15:26 2016 +0000

description:
Fix the out-of-memory behavior so the message doesn't disappear under
endwin(). Related to PR 3126.

diffstat:

 games/gomoku/main.c |  13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diffs (38 lines):

diff -r 86073c623347 -r 8b52a28be777 games/gomoku/main.c
--- a/games/gomoku/main.c       Sat Jun 11 23:10:01 2016 +0000
+++ b/games/gomoku/main.c       Sun Jun 12 02:15:26 2016 +0000
@@ -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 @@
 #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 @@
 {
        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);
 }



Home | Main Index | Thread Index | Old Index