* src/view.c (view_file_load_data): Do not to attempt to seek
beyond the end of file. Patch by Andrzej Zaborowski. (view_moveto_addr_cmd): Display a warning message if the user specified an invalid offset.
Этот коммит содержится в:
родитель
b33ded92e8
Коммит
370c1d2cb2
@ -1,3 +1,10 @@
|
|||||||
|
2006-12-30 Pavel Tsekov <ptsekov@gmx.net>
|
||||||
|
|
||||||
|
* view.c (view_file_load_data): Do not to attempt to seek
|
||||||
|
beyond the end of file. Patch by Andrzej Zaborowski.
|
||||||
|
(view_moveto_addr_cmd): Display a warning message if the
|
||||||
|
user specified an invalid offset.
|
||||||
|
|
||||||
2006-12-21 Pavel Tsekov <ptsekov@gmx.net>
|
2006-12-21 Pavel Tsekov <ptsekov@gmx.net>
|
||||||
|
|
||||||
* fsusage.c: Remove references to HAVE_INFOMOUNT.
|
* fsusage.c: Remove references to HAVE_INFOMOUNT.
|
||||||
|
@ -540,6 +540,9 @@ view_file_load_data (WView *view, offset_type byte_index)
|
|||||||
if (already_loaded (view->ds_file_offset, byte_index, view->ds_file_datalen))
|
if (already_loaded (view->ds_file_offset, byte_index, view->ds_file_datalen))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (byte_index >= view->ds_file_filesize)
|
||||||
|
return;
|
||||||
|
|
||||||
blockoffset = offset_rounddown (byte_index, view->ds_file_datasize);
|
blockoffset = offset_rounddown (byte_index, view->ds_file_datasize);
|
||||||
if (mc_lseek (view->ds_file_fd, blockoffset, SEEK_SET) == -1)
|
if (mc_lseek (view->ds_file_fd, blockoffset, SEEK_SET) == -1)
|
||||||
goto error;
|
goto error;
|
||||||
@ -2757,6 +2760,8 @@ view_moveto_addr_cmd (WView *view)
|
|||||||
addr = strtoul (line, &error, 0);
|
addr = strtoul (line, &error, 0);
|
||||||
if ((*error == '\0') && get_byte (view, addr) != -1) {
|
if ((*error == '\0') && get_byte (view, addr) != -1) {
|
||||||
view_moveto_offset (view, addr);
|
view_moveto_offset (view, addr);
|
||||||
|
} else {
|
||||||
|
message (D_ERROR, _("Warning"), _(" Invalid address "));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
g_free (line);
|
g_free (line);
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user