in edit_draw(), fix potential warnings when assigning -1 to paintlen by
using if/else clauses instead of "?" operators git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3964 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
5a8182e7df
commit
1c9dd109bf
|
@ -4,6 +4,10 @@ CVS code -
|
||||||
consistency. (DLR)
|
consistency. (DLR)
|
||||||
- Rename NANO_ALT_.* and NANO_.*ALTKEY to NANO_META_.* and
|
- Rename NANO_ALT_.* and NANO_.*ALTKEY to NANO_META_.* and
|
||||||
NANO_.*METAKEY, for consistency. (DLR)
|
NANO_.*METAKEY, for consistency. (DLR)
|
||||||
|
- winio.c:
|
||||||
|
edit_draw()
|
||||||
|
- Fix potential warnings when assigning -1 to paintlen by using
|
||||||
|
if/else clauses instead of "?" operators. (DLR)
|
||||||
- BUGS:
|
- BUGS:
|
||||||
- Miscellaneous cosmetic fixes. (DLR)
|
- Miscellaneous cosmetic fixes. (DLR)
|
||||||
|
|
||||||
|
|
14
src/winio.c
14
src/winio.c
|
@ -2513,8 +2513,11 @@ void edit_draw(const filestruct *fileptr, const char *converted, int
|
||||||
* expanded location of the end of the match minus
|
* expanded location of the end of the match minus
|
||||||
* the expanded location of the beginning of the
|
* the expanded location of the beginning of the
|
||||||
* page. */
|
* page. */
|
||||||
paintlen = (end_line != fileptr) ? -1 :
|
if (end_line != fileptr)
|
||||||
actual_x(converted, strnlenpt(fileptr->data,
|
paintlen = -1;
|
||||||
|
else
|
||||||
|
paintlen = actual_x(converted,
|
||||||
|
strnlenpt(fileptr->data,
|
||||||
endmatch.rm_eo) - start);
|
endmatch.rm_eo) - start);
|
||||||
|
|
||||||
mvwaddnstr(edit, line, 0, converted, paintlen);
|
mvwaddnstr(edit, line, 0, converted, paintlen);
|
||||||
|
@ -2639,8 +2642,11 @@ void edit_draw(const filestruct *fileptr, const char *converted, int
|
||||||
* Otherwise, paintlen is the expanded location of the end
|
* Otherwise, paintlen is the expanded location of the end
|
||||||
* of the mark minus the expanded location of the beginning
|
* of the mark minus the expanded location of the beginning
|
||||||
* of the mark. */
|
* of the mark. */
|
||||||
paintlen = (bot_x >= endpos) ? -1 : strnlenpt(fileptr->data,
|
if (bot_x >= endpos)
|
||||||
bot_x) - (x_start + start);
|
paintlen = -1;
|
||||||
|
else
|
||||||
|
paintlen = strnlenpt(fileptr->data, bot_x) - (x_start +
|
||||||
|
start);
|
||||||
|
|
||||||
/* If x_start is before the beginning of the page, shift
|
/* If x_start is before the beginning of the page, shift
|
||||||
* paintlen x_start characters to compensate, and put
|
* paintlen x_start characters to compensate, and put
|
||||||
|
|
Loading…
Reference in New Issue