X-Git-Url: https://ncurses.scripts.mit.edu/?a=blobdiff_plain;ds=inline;f=ncurses%2Ftty%2Ftty_update.c;h=16811f5e58ec79c5c68cd8799e9c22d13e53a664;hb=44a63c85c16f81579c74d68cd99eea1a1fd00c28;hp=fd4722b0683f9f9ecb11e265f9d8b25269f1d52f;hpb=76a479337308b4b5e749fa8c38b7b7f482998c5b;p=ncurses.git diff --git a/ncurses/tty/tty_update.c b/ncurses/tty/tty_update.c index fd4722b0..16811f5e 100644 --- a/ncurses/tty/tty_update.c +++ b/ncurses/tty/tty_update.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2015,2016 Free Software Foundation, Inc. * + * Copyright (c) 1998-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -82,7 +82,7 @@ #include -MODULE_ID("$Id: tty_update.c,v 1.283 2016/05/28 23:32:40 tom Exp $") +MODULE_ID("$Id: tty_update.c,v 1.286 2017/02/12 17:15:15 tom Exp $") /* * This define controls the line-breakout optimization. Every once in a @@ -676,7 +676,7 @@ EmitRange(NCURSES_SP_DCLx const NCURSES_CH_T * ntext, int num) TPARM_2(repeat_char, CharOf(ntext0), rep_count), - rep_count, + 1, NCURSES_SP_NAME(_nc_outch)); SP_PARM->_curscol += rep_count; @@ -1736,16 +1736,16 @@ InsStr(NCURSES_SP_DCLx NCURSES_CH_T * line, int count) TPUTS_TRACE("parm_ich"); NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx TPARM_1(parm_ich, count), - count, + 1, NCURSES_SP_NAME(_nc_outch)); - while (count) { + while (count > 0) { PutAttrChar(NCURSES_SP_ARGx CHREF(*line)); line++; count--; } } else if (enter_insert_mode && exit_insert_mode) { NCURSES_PUTP2("enter_insert_mode", enter_insert_mode); - while (count) { + while (count > 0) { PutAttrChar(NCURSES_SP_ARGx CHREF(*line)); if (insert_padding) { NCURSES_PUTP2("insert_padding", insert_padding); @@ -1755,7 +1755,7 @@ InsStr(NCURSES_SP_DCLx NCURSES_CH_T * line, int count) } NCURSES_PUTP2("exit_insert_mode", exit_insert_mode); } else { - while (count) { + while (count > 0) { NCURSES_PUTP2("insert_character", insert_character); PutAttrChar(NCURSES_SP_ARGx CHREF(*line)); if (insert_padding) { @@ -1789,7 +1789,7 @@ DelChar(NCURSES_SP_DCLx int count) TPUTS_TRACE("parm_dch"); NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx TPARM_1(parm_dch, count), - count, + 1, NCURSES_SP_NAME(_nc_outch)); } else { int n;