diff options
author | 2002-02-14 22:13:33 +0000 | |
---|---|---|
committer | 2002-02-14 22:13:33 +0000 | |
commit | 33c085f8683c186372f5d0340c394cb294395c10 (patch) | |
tree | f17229e755186f815bfbb65daa2f0a430133ac7f | |
parent | sync with other install.md scripts. also copy /boot from /usr/mdec, where it (diff) | |
download | wireguard-openbsd-33c085f8683c186372f5d0340c394cb294395c10.tar.xz wireguard-openbsd-33c085f8683c186372f5d0340c394cb294395c10.zip |
Avoid overflow in usage percent calculation. ok deraadt@
-rw-r--r-- | bin/csh/time.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/csh/time.c b/bin/csh/time.c index 6ed8c3edc12..2d80f3c8248 100644 --- a/bin/csh/time.c +++ b/bin/csh/time.c @@ -1,4 +1,4 @@ -/* $OpenBSD: time.c,v 1.5 1997/11/15 21:51:31 todd Exp $ */ +/* $OpenBSD: time.c,v 1.6 2002/02/14 22:13:33 nordin Exp $ */ /* $NetBSD: time.c,v 1.7 1995/03/21 13:55:25 mycroft Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)time.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: time.c,v 1.5 1997/11/15 21:51:31 todd Exp $"; +static char rcsid[] = "$OpenBSD: time.c,v 1.6 2002/02/14 22:13:33 nordin Exp $"; #endif #endif /* not lint */ @@ -174,7 +174,7 @@ prusage(r0, r1, e, b) case 'P': /* percent time spent running */ /* check if it did not run at all */ - i = (ms == 0) ? 0 : (t * 1000 / ms); + i = (ms == 0) ? 0 : ((long long)t * 1000 / ms); /* nn.n% */ (void) fprintf(cshout, "%ld.%01ld%%", i / 10, i % 10); break; |