mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-29 08:44:52 +02:00
[progressmeter.c] make compilers without long long happy.
This commit is contained in:
parent
140344b809
commit
4ea542b41a
@ -1,5 +1,6 @@
|
|||||||
20030120
|
20030120
|
||||||
- (djm) Fix compilation for NetBSD from dtucker@zip.com.au
|
- (djm) Fix compilation for NetBSD from dtucker@zip.com.au
|
||||||
|
- (tim) [progressmeter.c] make compilers without long long happy.
|
||||||
|
|
||||||
20030118
|
20030118
|
||||||
- (djm) Revert fix for Bug #442 for now.
|
- (djm) Revert fix for Bug #442 for now.
|
||||||
@ -1037,4 +1038,4 @@
|
|||||||
save auth method before monitor_reset_key_state(); bugzilla bug #284;
|
save auth method before monitor_reset_key_state(); bugzilla bug #284;
|
||||||
ok provos@
|
ok provos@
|
||||||
|
|
||||||
$Id: ChangeLog,v 1.2576 2003/01/20 02:15:10 djm Exp $
|
$Id: ChangeLog,v 1.2577 2003/01/20 04:15:13 tim Exp $
|
||||||
|
@ -203,6 +203,7 @@ draw_progress_meter()
|
|||||||
|
|
||||||
nspaces = MIN(get_tty_width() - 79, sizeof(spaces) - 1);
|
nspaces = MIN(get_tty_width() - 79, sizeof(spaces) - 1);
|
||||||
|
|
||||||
|
#ifdef HAVE_LONG_LONG_INT
|
||||||
snprintf(buf, sizeof(buf),
|
snprintf(buf, sizeof(buf),
|
||||||
"\r%-45.45s%.*s%3d%% %4lld%c%c %3lld.%01d%cB/s",
|
"\r%-45.45s%.*s%3d%% %4lld%c%c %3lld.%01d%cB/s",
|
||||||
curfile,
|
curfile,
|
||||||
@ -216,6 +217,22 @@ draw_progress_meter()
|
|||||||
(int)((bytespersec % 1024) * 10 / 1024),
|
(int)((bytespersec % 1024) * 10 / 1024),
|
||||||
prefixes[bi]
|
prefixes[bi]
|
||||||
);
|
);
|
||||||
|
#else
|
||||||
|
/* XXX: Handle integer overflow? */
|
||||||
|
snprintf(buf, sizeof(buf),
|
||||||
|
"\r%-45.45s%.*s%3d%% %4lu%c%c %3lu.%01d%cB/s",
|
||||||
|
curfile,
|
||||||
|
nspaces,
|
||||||
|
spaces,
|
||||||
|
ratio,
|
||||||
|
(u_long)abbrevsize,
|
||||||
|
prefixes[ai],
|
||||||
|
ai == 0 ? ' ' : 'B',
|
||||||
|
(u_long)(bytespersec / 1024),
|
||||||
|
(int)((bytespersec % 1024) * 10 / 1024),
|
||||||
|
prefixes[bi]
|
||||||
|
);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (cursize <= 0 || elapsed <= 0.0 || cursize > totalbytes) {
|
if (cursize <= 0 || elapsed <= 0.0 || cursize > totalbytes) {
|
||||||
snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
|
snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user