summaryrefslogtreecommitdiff
path: root/usr.bin/ssh
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2003-08-31 12:14:23 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2003-08-31 12:14:23 +0000
commit650c1c55ea0cd58fa2c607055e82658a1c7c2ba9 (patch)
treebd3198e27b526c9c7bf7bae1c0c4e78af2eac4d0 /usr.bin/ssh
parenta431106588eff3c72183747d53136e06408dac55 (diff)
do write to buf[-1]
Diffstat (limited to 'usr.bin/ssh')
-rw-r--r--usr.bin/ssh/progressmeter.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/ssh/progressmeter.c b/usr.bin/ssh/progressmeter.c
index 4f74ff54d76..4b82ad9b844 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.14 2003/08/31 10:26:04 markus Exp $");
+RCSID("$OpenBSD: progressmeter.c,v 1.15 2003/08/31 12:14:22 markus Exp $");
#include "progressmeter.h"
#include "atomicio.h"
@@ -140,6 +140,8 @@ refresh_progress_meter(void)
file_len = win_size - 35;
if (file_len > 0) {
len = snprintf(buf, file_len + 1, "\r%s", file);
+ if (len < 0)
+ len = 0;
for (i = len; i < file_len; i++ )
buf[i] = ' ';
buf[file_len] = '\0';