summaryrefslogtreecommitdiff
path: root/progressmeter.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2003-09-02 22:53:01 +1000
committerDamien Miller <djm@mindrot.org>2003-09-02 22:53:01 +1000
commit17af176302916a5f97174063773a173a324fe093 (patch)
tree7493493f80942ade39aa2c0646786bbac3769e7a /progressmeter.c
parentfbdeecef92bbf5b265bdb8d8c876c6989a0e8c9e (diff)
- markus@cvs.openbsd.org 2003/08/31 10:26:04
[progressmeter.c] pass file_size + 1 to snprintf: fixes printing of truncated file names; fix based on patch/report from sturm@;
Diffstat (limited to 'progressmeter.c')
-rw-r--r--progressmeter.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/progressmeter.c b/progressmeter.c
index 9fe8cfa41..9d5b42a20 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.13 2003/07/31 22:34:03 markus Exp $"); 26RCSID("$OpenBSD: progressmeter.c,v 1.14 2003/08/31 10:26:04 markus Exp $");
27 27
28#include "progressmeter.h" 28#include "progressmeter.h"
29#include "atomicio.h" 29#include "atomicio.h"
@@ -140,7 +140,7 @@ refresh_progress_meter(void)
140 buf[0] = '\0'; 140 buf[0] = '\0';
141 file_len = win_size - 35; 141 file_len = win_size - 35;
142 if (file_len > 0) { 142 if (file_len > 0) {
143 len = snprintf(buf, file_len, "\r%s", file); 143 len = snprintf(buf, file_len + 1, "\r%s", file);
144 for (i = len; i < file_len; i++ ) 144 for (i = len; i < file_len; i++ )
145 buf[i] = ' '; 145 buf[i] = ' ';
146 buf[file_len] = '\0'; 146 buf[file_len] = '\0';