From: Phil Pennock Date: Mon, 14 Jul 2014 06:59:52 +0000 (-0400) Subject: Fix unsigned < 0 check X-Git-Tag: exim-4_83~7 X-Git-Url: https://vcs.fsf.org/?p=exim.git;a=commitdiff_plain;h=cb54b2a05b5f5f3548ac98e74b90eb8633052919;hp=cb54b2a05b5f5f3548ac98e74b90eb8633052919 Fix unsigned < 0 check Two places in malware.c were using `fsize`, defined as `unsigned int`, to receive the result of `lseek()` and then checking if the value was less than 0. As clang says: ``` malware.c:1228:46: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare] if ((fsize = lseek(clam_fd, 0, SEEK_END)) < 0) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~ ``` Fix. Use `off_t`, which we're already using elsewhere, then use `fsize_uint` to handle off_t being potentially 64-bit, and a sanity-check on conversion which hopefully won't be optimised away by compilers. ---