Fix unsigned < 0 check
authorPhil Pennock <pdp@exim.org>
Mon, 14 Jul 2014 06:59:52 +0000 (02:59 -0400)
committerPhil Pennock <pdp@exim.org>
Mon, 14 Jul 2014 06:59:52 +0000 (02:59 -0400)
commitcb54b2a05b5f5f3548ac98e74b90eb8633052919
treeaea8ddc349e08b12b93202486e7d6351484339ed
parent66be95e02b2ba6a834a6dbee16061176ad85019a
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.
src/src/malware.c