]> andersk Git - openssh.git/blobdiff - progressmeter.c
- (tim) [configure.ac] set TEST_SHELL for OpenServer 6
[openssh.git] / progressmeter.c
index 629a536b28f265689af8031a20bf5c1a606cf014..febe9aad59faadf8715a99368db5f58638703a6c 100644 (file)
@@ -23,7 +23,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: progressmeter.c,v 1.21 2004/06/21 17:36:31 avsm Exp $");
+RCSID("$OpenBSD: progressmeter.c,v 1.23 2005/04/28 10:17:56 moritz Exp $");
 
 #include "progressmeter.h"
 #include "atomicio.h"
@@ -48,15 +48,15 @@ void refresh_progress_meter(void);
 /* signal handler for updating the progress meter */
 static void update_progress_meter(int);
 
-static time_t start;           /* start progress */
-static time_t last_update;     /* last progress update */
-static char *file;             /* name of the file being transferred */
-static off_t end_pos;          /* ending position of transfer */
-static off_t cur_pos;          /* transfer position as of last refresh */
+static time_t start;           /* start progress */
+static time_t last_update;     /* last progress update */
+static char *file;             /* name of the file being transferred */
+static off_t end_pos;          /* ending position of transfer */
+static off_t cur_pos;          /* transfer position as of last refresh */
 static volatile off_t *counter;        /* progress counter */
-static long stalled;           /* how long we have been stalled */
-static int bytes_per_second;   /* current speed in bytes per second */
-static int win_size;           /* terminal window size */
+static long stalled;           /* how long we have been stalled */
+static int bytes_per_second;   /* current speed in bytes per second */
+static int win_size;           /* terminal window size */
 
 /* units for format_size */
 static const char unit[] = " KMGT";
@@ -147,6 +147,8 @@ refresh_progress_meter(void)
                len = snprintf(buf, file_len + 1, "\r%s", file);
                if (len < 0)
                        len = 0;
+               if (len >= file_len + 1)
+                       len = file_len;
                for (i = len;  i < file_len; i++ )
                        buf[i] = ' ';
                buf[file_len] = '\0';
This page took 0.034919 seconds and 4 git commands to generate.