summaryrefslogtreecommitdiff
path: root/progressmeter.c
diff options
context:
space:
mode:
Diffstat (limited to 'progressmeter.c')
-rw-r--r--progressmeter.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/progressmeter.c b/progressmeter.c
index 93f5a3e62..febe9aad5 100644
--- a/progressmeter.c
+++ b/progressmeter.c
@@ -23,7 +23,7 @@
23 */ 23 */
24 24
25#include "includes.h" 25#include "includes.h"
26RCSID("$OpenBSD: progressmeter.c,v 1.22 2004/07/11 17:48:47 deraadt Exp $"); 26RCSID("$OpenBSD: progressmeter.c,v 1.23 2005/04/28 10:17:56 moritz Exp $");
27 27
28#include "progressmeter.h" 28#include "progressmeter.h"
29#include "atomicio.h" 29#include "atomicio.h"
@@ -147,6 +147,8 @@ refresh_progress_meter(void)
147 len = snprintf(buf, file_len + 1, "\r%s", file); 147 len = snprintf(buf, file_len + 1, "\r%s", file);
148 if (len < 0) 148 if (len < 0)
149 len = 0; 149 len = 0;
150 if (len >= file_len + 1)
151 len = file_len;
150 for (i = len; i < file_len; i++ ) 152 for (i = len; i < file_len; i++ )
151 buf[i] = ' '; 153 buf[i] = ' ';
152 buf[file_len] = '\0'; 154 buf[file_len] = '\0';