tty fix for bad curs positioning (-1,n)

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.
This commit is contained in:
PatR
2015-04-07 01:23:16 -07:00
parent 13185adad2
commit f5b71c5b8f

View 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