diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2003-07-30 07:44:15 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2003-07-30 07:44:15 +0000 |
commit | de4e4cb835d53fa7b9a72144a19ef9d30c8eafd3 (patch) | |
tree | 31290b8b209f5240e003d3b8fb0b5ae59acb327d /usr.bin | |
parent | 9356021ebd020c39f473186a1f8187b861033f12 (diff) |
use only 4 digits in format_size
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/ssh/progressmeter.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/usr.bin/ssh/progressmeter.c b/usr.bin/ssh/progressmeter.c index ec9f3269885..b8bb49c31b6 100644 --- a/usr.bin/ssh/progressmeter.c +++ b/usr.bin/ssh/progressmeter.c @@ -23,7 +23,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: progressmeter.c,v 1.10 2003/07/29 18:26:46 markus Exp $"); +RCSID("$OpenBSD: progressmeter.c,v 1.11 2003/07/30 07:44:14 markus Exp $"); #include "progressmeter.h" #include "atomicio.h" @@ -69,9 +69,9 @@ format_size(char *buf, int size, off_t bytes) static const char unit[] = " KMGT"; int i; - for (i = 0; bytes > 10240 && unit[i] != 'T'; i++) + for (i = 0; bytes >= 10000 && unit[i] != 'T'; i++) bytes /= 1024; - snprintf(buf, size, "%6lld%c%s", + snprintf(buf, size, "%4lld%c%s", (long long) bytes, unit[i], i ? "B" : " "); @@ -114,11 +114,9 @@ refresh_progress_meter(void) } else bytes_per_second = cur_speed; -memset(buf, 'a', sizeof(buf)); - /* filename */ buf[0] = '\0'; - file_len = win_size - 36; + file_len = win_size - 34; if (file_len > 0) { len = snprintf(buf, file_len, "\r%s", file); for (i = len; i < file_len; i++ ) |