mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 04:46:55 +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>
|
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.
|
* command.c (command_new): Fix memory leak.
|
||||||
* subshell.c (exit_subshell): Free pty_buffer.
|
* subshell.c (exit_subshell): Free pty_buffer.
|
||||||
|
|
||||||
|
@ -336,7 +336,7 @@ get_byte (WView *view, unsigned int byte_index)
|
|||||||
}
|
}
|
||||||
view->blocks = page;
|
view->blocks = page;
|
||||||
}
|
}
|
||||||
if (byte_index > view->bytes_read) {
|
if (byte_index >= view->bytes_read) {
|
||||||
return -1;
|
return -1;
|
||||||
} else
|
} else
|
||||||
return view->block_ptr[page - 1].data[offset];
|
return view->block_ptr[page - 1].data[offset];
|
||||||
|
Loading…
Reference in New Issue
Block a user