From: guy Date: Thu, 17 Nov 2011 06:36:32 +0000 (+0000) Subject: Return *some* error if we end up trying to seek before the beginning of X-Git-Url: http://git.samba.org/samba.git/?p=obnox%2Fwireshark%2Fwip.git;a=commitdiff_plain;h=eac7cee5658631878c64d5650a79293f7d1b1b5d Return *some* error if we end up trying to seek before the beginning of the file, so you don't get weird random errors. EINVAL is as good as anything. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39896 f5534014-38df-0310-8fa8-9805f1628bb7 --- diff --git a/wiretap/file_wrappers.c b/wiretap/file_wrappers.c index f8b9b8c8eb..7baa0abe07 100644 --- a/wiretap/file_wrappers.c +++ b/wiretap/file_wrappers.c @@ -982,7 +982,7 @@ file_seek(FILE_T file, gint64 offset, int whence, int *err) if (offset < 0) { offset += file->pos; if (offset < 0) { /* before start of file! */ - /* *err = ???; */ + *err = EINVAL; return -1; } /* rewind, then skip to offset */