[hackers] [sbase][PATCH] Fixed a couple of uninitialised variable warnings from Clang

From: Simon Cooksey <sjc205_AT_kent.ac.uk>
Date: Thu, 2 Feb 2017 14:43:26 +0000

- ed.c
   Initialise hline in `static int makeline(char, int)'

- join.c
   Intitalise fileno and fldno in `static struct spec * makespec(char)'
---
 ed.c   | 2 +-
 join.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/ed.c b/ed.c
index 4b28848..ae66b8d 100644
--- a/ed.c
+++ b/ed.c
_AT_@ -155,7 +155,7 @@ back(int c)
 static int
 makeline(char *s, int *off)
 {
-	struct hline *lp;
+	struct hline *lp = 0;
 	size_t len;
 	char c, *begin = s;
 
diff --git a/join.c b/join.c
index d3e2343..6145654 100644
--- a/join.c
+++ b/join.c
_AT_@ -314,8 +314,8 @@ static struct spec *
 makespec(char *s)
 {
 	struct spec *sp;
-	int fileno;
-	size_t fldno;
+	int fileno = 0;
+	size_t fldno = 0;
 
 	if (!strcmp(s, "0")) {   /* join field must be 0 and nothing else */
 		fileno = 0;
-- 
2.11.0
Received on Thu Feb 02 2017 - 15:43:26 CET

This archive was generated by hypermail 2.3.0 : Thu Feb 02 2017 - 15:48:20 CET