]> granicus.if.org Git - nethack/commitdiff
tty fix for bad curs positioning (-1,n)
authorPatR <rankin@nethack.org>
Tue, 7 Apr 2015 08:23:16 +0000 (01:23 -0700)
committerPatR <rankin@nethack.org>
Tue, 7 Apr 2015 08:23:16 +0000 (01:23 -0700)
DEBUGFILES set to "wintty.c" reported a bad cursor positioning attempt
at the end of the RIP tombstone, and when set to "questpgr.c wintty.c"
reported a whole bunch right at the start of the game when enumerating
all the quest messages for the chosen role.  Both were triggered by
this x==0 call to tty_curs() near the end of process_text_window().
    if (i == cw->maxrow) {
        if(cw->type == NHW_TEXT){
            tty_curs(BASE_WINDOW, 0, (int)ttyDisplay->cury+1);
            cl_eos();
        }
    ...
The x value is always decremented in tty_curs, so passing in 0 yields
a bad value of -1.  The bad call returns without doing anything, and
when DEBUG is disabled, it does so silently.

No fixes entry; it was caused by a post-3.4.3 fix for something else.

win/tty/wintty.c

index 0aaf9e92dc285e0d1168a91374a61a561cf1877a..bcf4041e08dbcfd70a0d371fdb8af1136f9b7f73 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.5 wintty.c        $NHDT-Date: 1427667623 2015/03/29 22:20:23 $  $NHDT-Branch: master $:$NHDT-Revision: 1.75 $ */
+/* NetHack 3.5 wintty.c        $NHDT-Date: 1428394244 2015/04/07 08:10:44 $  $NHDT-Branch: master $:$NHDT-Revision: 1.84 $ */
 /* NetHack 3.5 wintty.c        $Date: 2012/01/22 06:27:09 $  $Revision: 1.66 $ */
 /* Copyright (c) David Cohrs, 1991                               */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -1770,7 +1770,7 @@ struct WinDesc *cw;
     if (i == cw->maxrow) {
 #ifdef H2344_BROKEN
        if(cw->type == NHW_TEXT){
-           tty_curs(BASE_WINDOW, 0, (int)ttyDisplay->cury+1);
+           tty_curs(BASE_WINDOW, 1, (int)ttyDisplay->cury+1);
            cl_eos();
        }
 #endif