diff options
-rw-r--r-- | wiretap/file_wrappers.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/wiretap/file_wrappers.c b/wiretap/file_wrappers.c index 443bd5ce6d..3f5e5e23f0 100644 --- a/wiretap/file_wrappers.c +++ b/wiretap/file_wrappers.c @@ -921,7 +921,12 @@ file_seek(FILE_T file, gint64 offset, int whence, int *err) file->seek = 0; if (offset < 0 && file->next) { - ptrdiff_t had = file->next - file->out; + /* + * This is guaranteed to fit in an unsigned int. + * To squelch compiler warnings, we cast the + * result. + */ + unsigned had = (unsigned)(file->next - file->out); if (-offset <= had) { file->have -= offset; file->next += offset; |