commit 0b48c28715bcc07187be5d35c5b832537bf51f18
parent def36a5ecb027e64603dd9eafc8e3fd4f24557e8
Author: Quentin Rameau <quinq@fifth.space>
Date: Mon, 14 Dec 2015 01:28:39 +0100
Cleanup linenum()
Return early if no line number is found and do not assign uninitialized
value to line output parameter.
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/ed.c b/ed.c
@@ -439,7 +439,7 @@ invalid:
static int
linenum(int *line)
{
- int ln, c, ret = 1;
+ int ln, c;
skipblank();
@@ -473,11 +473,11 @@ linenum(int *line)
if (isdigit(c))
ln = getnum();
else
- ret = 0;
+ return 0;
break;
}
*line = ln;
- return ret;
+ return 1;
}
static int