* view.c (view_move_forward2): Early return if get_byte() returns

-1.
This commit is contained in:
Roland Illig 2005-04-19 21:27:03 +00:00
parent 1c367fbab4
commit 2842c33f11
2 changed files with 5 additions and 2 deletions

View File

@ -6,6 +6,8 @@
Replaced 0 literals with FALSE.
* view.c (view_free_growing_buffer): Renamed to
view_growbuf_free(). Simplified the code.
* view.c (view_move_forward2): Early return if get_byte() returns
-1.
2005-04-18 Roland Illig <roland.illig@gmx.de>

View File

@ -1225,8 +1225,9 @@ view_move_forward2 (WView *view, offset_type current, int lines, offset_type upt
if (lines != -1 && line >= lines)
return p;
/* FIXME: what if get_byte() returns -1? */
c = get_byte (view, p);
/* end of file or reading error -- stop going forward */
if ((c = get_byte (view, p)) == -1)
return p;
if (view->text_wrap_mode) {
if (c == '\r')