From d08f3360f435f17590416857a95fa9ccfe19204c Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Fri, 28 Jul 2017 14:26:57 +0200 Subject: treewide: Kill assignments in if conditions. Somewhat hard to read and the code base already has many overlong lines Found with below spatch files: @parens@ expression E, F, G; binary operator X; statement S; @@ - if ((E = F) X G) + E = F; + if (E X G) S Signed-off-by: Ralf Baechle --- ax25ipd/config.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ax25ipd/config.c') diff --git a/ax25ipd/config.c b/ax25ipd/config.c index e0db591..ecbd1c2 100644 --- a/ax25ipd/config.c +++ b/ax25ipd/config.c @@ -87,7 +87,8 @@ void config_read(char *f) else fname=f; - if ((cf = fopen(fname, "r")) == NULL) { + cf = fopen(fname, "r"); + if (cf == NULL) { fprintf(stderr, "Config file %s not found or could not be opened\n", fname); @@ -99,7 +100,8 @@ void config_read(char *f) while (fgets(buf, 255, cf) != NULL) { strcpy(cbuf, buf); lineno++; - if ((e = parse_line(buf)) < 0) { + e = parse_line(buf); + if (e < 0) { fprintf(stderr, "Config error at line %d: ", lineno); if (e == -1) -- cgit v1.2.3