diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2006-08-07 18:20:58 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2006-08-07 18:20:58 +0000 |
commit | 3068789032fc0441a1855f0619000168e01e01a0 (patch) | |
tree | f375755dc71accb04493da327568ed2f200a7898 /usr.sbin/fdformat | |
parent | 7e37df37e716d502f4a4a65b408e64ac24ce83ad (diff) |
Avoid divide by zero in visual effects; spotted by Tobias Stoeckmann.
Diffstat (limited to 'usr.sbin/fdformat')
-rw-r--r-- | usr.sbin/fdformat/fdformat.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/fdformat/fdformat.c b/usr.sbin/fdformat/fdformat.c index 748b21d4a39..26ca05ebee2 100644 --- a/usr.sbin/fdformat/fdformat.c +++ b/usr.sbin/fdformat/fdformat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fdformat.c,v 1.14 2006/04/02 00:50:42 deraadt Exp $ */ +/* $OpenBSD: fdformat.c,v 1.15 2006/08/07 18:20:57 miod Exp $ */ /* * Copyright (C) 1992-1994 by Joerg Wunsch, Dresden @@ -281,6 +281,8 @@ main(int argc, char *argv[]) bytes_per_track = fdt.sectrac * (1<<fdt.secsize) * 128; tracks_per_dot = fdt.tracks * fdt.heads / 40; + if (tracks_per_dot == 0) + tracks_per_dot++; if (verify_only) { if (!quiet) |