changeset 1272:bdc28287f077

explicitly initialization of static variables
author Francois Perrad <francois.perrad@gadz.org>
date Fri, 01 Jan 2016 09:15:41 +0100
parents 26622eee1e8b
children 139935236c72
files scp.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/scp.c	Fri Jan 01 09:03:55 2016 +0100
+++ b/scp.c	Fri Jan 01 09:15:41 2016 +0100
@@ -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;
 
@@ -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;