summaryrefslogtreecommitdiff
path: root/scp.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-07-02 19:13:56 +1000
committerDamien Miller <djm@mindrot.org>2000-07-02 19:13:56 +1000
commit484118ea0f6871c2429c45f0736ba07b8289561d (patch)
tree8e0434ce196d095be196d54f7741871a9c54e777 /scp.c
parentc708843e6a209b1c1f1a6d3e60b29be56d1d8894 (diff)
- (djm) Use standard OpenSSL functions in auth-skey.c. Patch from
Chris, the Young One <cky@pobox.com>
Diffstat (limited to 'scp.c')
-rw-r--r--scp.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/scp.c b/scp.c
index 0a89985de..5f849cc13 100644
--- a/scp.c
+++ b/scp.c
@@ -56,6 +56,14 @@ RCSID("$OpenBSD: scp.c,v 1.32 2000/06/20 01:39:44 markus Exp $");
56/* For progressmeter() -- number of seconds before xfer considered "stalled" */ 56/* For progressmeter() -- number of seconds before xfer considered "stalled" */
57#define STALLTIME 5 57#define STALLTIME 5
58 58
59/* Progress meter bar */
60#define BAR \
61 "************************************************************"\
62 "************************************************************"\
63 "************************************************************"\
64 "************************************************************"
65#define MAX_BARLENGTH (sizeof(BAR) - 1)
66
59/* Visual statistics about files as they are transferred. */ 67/* Visual statistics about files as they are transferred. */
60void progressmeter(int); 68void progressmeter(int);
61 69
@@ -1172,13 +1180,11 @@ progressmeter(int flag)
1172 snprintf(buf, sizeof(buf), "\r%-20.20s %3d%% ", curfile, ratio); 1180 snprintf(buf, sizeof(buf), "\r%-20.20s %3d%% ", curfile, ratio);
1173 1181
1174 barlength = getttywidth() - 51; 1182 barlength = getttywidth() - 51;
1183 barlength = (barlength <= MAX_BARLENGTH)?barlength:MAX_BARLENGTH;
1175 if (barlength > 0) { 1184 if (barlength > 0) {
1176 i = barlength * ratio / 100; 1185 i = barlength * ratio / 100;
1177 snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), 1186 snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
1178 "|%.*s%*s|", i, 1187 "|%.*s%*s|", i, BAR, barlength - i, "");
1179 "*****************************************************************************"
1180 "*****************************************************************************",
1181 barlength - i, "");
1182 } 1188 }
1183 i = 0; 1189 i = 0;
1184 abbrevsize = cursize; 1190 abbrevsize = cursize;