summaryrefslogtreecommitdiffstats
path: root/usr.bin/diff/diff.c
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2003-06-25 02:18:35 +0000
committerkrw <krw@openbsd.org>2003-06-25 02:18:35 +0000
commit2d982cfb4bab0a81601b807224739dabe6819f11 (patch)
tree3f74332ba1d4eee4896d6ca28232bdb540e0e6e4 /usr.bin/diff/diff.c
parenta Makefile (diff)
downloadwireguard-openbsd-2d982cfb4bab0a81601b807224739dabe6819f11.tar.xz
wireguard-openbsd-2d982cfb4bab0a81601b807224739dabe6819f11.zip
Avoid a divide by zero by
1) Ensuring that both sd_scsi.c and sd_atapi.c report a device as offline when its disksize cannot be determined. 2) Ensuring blksize is always non-zero, with a default value of 512. 3) Eliminating a couple of unneeded 'sectors' variables, which makes the code easier for me to read if nothing else. The bug was introduced when sd_atapi.c was changed to allow 'incomplete' implementations to be reported as online. REALLY incomplete implementations (i.e. not even the disksize can be determined) would be reported online with a blksize of zero. Also fix a couple of knf nits in Mickey's last commit, and add another check for an rpm of 0. ok (pre-Mickey diffs) tdeval@ marc@ frantzen@
Diffstat (limited to 'usr.bin/diff/diff.c')
0 files changed, 0 insertions, 0 deletions