diff scp.c @ 1278:0c47d97aa9d5

merge
author Matt Johnston <matt@ucc.asn.au>
date Wed, 16 Mar 2016 22:53:27 +0800
parents 07ee7736397e
children 750ec4ec4cbe
line wrap: on
line diff
--- a/scp.c	Tue Mar 15 23:23:31 2016 +0800
+++ b/scp.c	Wed Mar 16 22:53:27 2016 +0800
@@ -672,7 +672,7 @@
 			}
 			continue;
 		}
-#if PROGRESS_METER
+#ifdef PROGRESS_METER
 		if (showprogress)
 			start_progress_meter(curfile, stb.st_size, &statbytes);
 #endif
@@ -772,7 +772,7 @@
 bwlimit(int amount)
 {
 	static struct timeval bwstart, bwend;
-	static int lamt, thresh = 16384;
+	static int lamt = 0, thresh = 16384;
 	uint64_t waitlen;
 	struct timespec ts, rm;
 
@@ -841,7 +841,7 @@
 
 #define	atime	tv[0]
 #define	mtime	tv[1]
-#define	SCREWUP(str)	{ why = str; goto screwup; }
+#define	SCREWUP(str)	do { why = str; goto screwup; } while (0)
 
 	setimes = targisdir = 0;
 	mask = umask(0);
@@ -940,8 +940,8 @@
 			exit(1);
 		}
 		if (targisdir) {
-			static char *namebuf;
-			static size_t cursize;
+			static char *namebuf = NULL;
+			static size_t cursize = 0;
 			size_t need;
 
 			need = strlen(targ) + strlen(cp) + 250;
@@ -1153,7 +1153,7 @@
 void
 run_err(const char *fmt,...)
 {
-	static FILE *fp;
+	static FILE *fp = NULL;
 	va_list ap;
 
 	++errs;