mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
* view.c (get_byte): Fix off-by-one error. Found by Valgrind.
This commit is contained in:
parent
f0e6a9d522
commit
bd9c9343eb
@ -1,5 +1,7 @@
|
||||
2003-06-06 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* view.c (get_byte): Fix off-by-one error. Found by Valgrind.
|
||||
|
||||
* command.c (command_new): Fix memory leak.
|
||||
* subshell.c (exit_subshell): Free pty_buffer.
|
||||
|
||||
|
@ -336,7 +336,7 @@ get_byte (WView *view, unsigned int byte_index)
|
||||
}
|
||||
view->blocks = page;
|
||||
}
|
||||
if (byte_index > view->bytes_read) {
|
||||
if (byte_index >= view->bytes_read) {
|
||||
return -1;
|
||||
} else
|
||||
return view->block_ptr[page - 1].data[offset];
|
||||
|
Loading…
Reference in New Issue
Block a user