[hackers] [sbase][ed] Cleanup linenum()

From: Quentin Rameau <quinq_AT_fifth.space>
Date: Mon, 14 Dec 2015 01:28:39 +0100

Return early if no line number is found and do not assign uninitialized
value to line output parameter.
---
 ed.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/ed.c b/ed.c
index 2851729..200bd1d 100644
--- a/ed.c
+++ b/ed.c
_AT_@ -368,7 +368,7 @@ invalid:
 static int
 linenum(int *line)
 {
-	int ln, c, ret = 1;
+	int ln, c;
 
 	skipblank();
 
_AT_@ -402,11 +402,11 @@ linenum(int *line)
 		if (isdigit(c))
 			ln = getnum();
 		else
-			ret = 0;
+			return 0;
 		break;
 	}
 	*line = ln;
-	return ret;
+	return 1;
 }
 
 static int
-- 
2.6.4
Received on Mon Dec 14 2015 - 01:28:39 CET

This archive was generated by hypermail 2.3.0 : Mon Dec 14 2015 - 01:36:13 CET