diff options
author | 2003-06-25 02:18:35 +0000 | |
---|---|---|
committer | 2003-06-25 02:18:35 +0000 | |
commit | 2d982cfb4bab0a81601b807224739dabe6819f11 (patch) | |
tree | 3f74332ba1d4eee4896d6ca28232bdb540e0e6e4 /usr.bin/diff/diff.c | |
parent | a Makefile (diff) | |
download | wireguard-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