]> git.cameronkatri.com Git - bsd-progress.git/blobdiff - progressbar.c
copyright maintenance
[bsd-progress.git] / progressbar.c
index 717b032dd70f1501d3052bf0b1da5561663da7c0..18f12ef383ad0d28ec028423f72d5a5f325e1418 100644 (file)
@@ -1,7 +1,7 @@
-/*     $NetBSD: progressbar.c,v 1.7 2005/04/11 01:49:31 lukem Exp $    */
+/*     $NetBSD: progressbar.c,v 1.10 2005/06/09 16:38:29 lukem Exp $   */
 
 /*-
- * Copyright (c) 1997-2003 The NetBSD Foundation, Inc.
+ * Copyright (c) 1997-2005 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: progressbar.c,v 1.7 2005/04/11 01:49:31 lukem Exp $");
+__RCSID("$NetBSD: progressbar.c,v 1.10 2005/06/09 16:38:29 lukem Exp $");
 #endif /* not lint */
 
 /*
@@ -121,7 +121,8 @@ progressmeter(int flag)
        struct timeval td;
        off_t abbrevsize, bytespersec;
        double elapsed;
-       int ratio, barlength, i, remaining;
+       int ratio, i, remaining;
+       size_t barlength;
 
                        /*
                         * Work variables for progress bar.
@@ -132,7 +133,7 @@ progressmeter(int flag)
                         *      these appropriately.
                         */
 #endif
-       int len;
+       size_t          len;
        char            buf[256];       /* workspace for progress bar */
 #ifndef NO_PROGRESS
 #define        BAROVERHEAD     43              /* non `*' portion of progress bar */
@@ -219,7 +220,7 @@ progressmeter(int flag)
                if (barlength > 0) {
                        i = barlength * ratio / 100;
                        len += snprintf(buf + len, BUFLEFT,
-                           "|%.*s%*s|", i, stars, barlength - i, "");
+                           "|%.*s%*s|", i, stars, (int)(barlength - i), "");
                }
        }
 
@@ -296,7 +297,8 @@ ptransfer(int siginfo)
        struct timeval now, td, wait;
        double elapsed;
        off_t bytespersec;
-       int remaining, hh, i, len;
+       int remaining, hh, i;
+       size_t len;
 
        char buf[256];          /* Work variable for transfer status. */