diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2017-07-28 14:26:57 +0200 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2017-08-03 03:46:12 +0200 |
commit | d08f3360f435f17590416857a95fa9ccfe19204c (patch) | |
tree | 0a3434ba7d43bd3d4be7081377f147da400268f1 /ax25ipd/config.c | |
parent | b541f5ddd8936a1f2fa69d1917d6812139da0c4e (diff) |
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 <ralf@linux-mips.org>
Diffstat (limited to 'ax25ipd/config.c')
-rw-r--r-- | ax25ipd/config.c | 6 |
1 files changed, 4 insertions, 2 deletions
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) |