diff options
author | mav <mav@FreeBSD.org> | 2018-02-01 21:04:10 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2018-02-01 21:04:10 +0000 |
commit | aded2913d9c2dd4a0d7e51902fc4d1b9bd0cbfab (patch) | |
tree | 065b2fa181002ffb740ecf59a3719164ba3321eb | |
parent | 338675dafc7597edd5feb67877366587857b5248 (diff) | |
download | FreeBSD-src-aded2913d9c2dd4a0d7e51902fc4d1b9bd0cbfab.zip FreeBSD-src-aded2913d9c2dd4a0d7e51902fc4d1b9bd0cbfab.tar.gz |
MFC r320522 (by imp):
Fix sign of resid and add a mostly useless cast to cope with signed vs
unsigned check warnings from traditional unix code construsts bogusly
flagged as potentially unsafe.
-rw-r--r-- | sbin/nvmecontrol/wdc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/nvmecontrol/wdc.c b/sbin/nvmecontrol/wdc.c index ae9fbfc..8f3e895 100644 --- a/sbin/nvmecontrol/wdc.c +++ b/sbin/nvmecontrol/wdc.c @@ -105,7 +105,7 @@ wdc_do_dump(int fd, char *tmpl, const char *suffix, uint32_t opcode, int fd2; uint8_t *buf; uint32_t len, offset; - ssize_t resid; + size_t resid; wdc_append_serial_name(fd, tmpl, MAXPATHLEN, suffix); @@ -142,7 +142,7 @@ wdc_do_dump(int fd, char *tmpl, const char *suffix, uint32_t opcode, resid = len; first = 0; } - if (write(fd2, buf, resid) != resid) + if (write(fd2, buf, resid) != (ssize_t)resid) err(1, "write"); offset += resid; len -= resid; |