summaryrefslogtreecommitdiffstats
path: root/tcpip/rip98r.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2017-07-28 14:10:07 +0200
committerRalf Baechle <ralf@linux-mips.org>2017-07-31 04:29:44 +0200
commitdaba307035faf4cc01f1ccb883b21281d91234cc (patch)
treeedbd5df9285303f281524fac8064866057ce35ce /tcpip/rip98r.c
parent71b0582584ac5de97141ea207ddf17f7c938b2df (diff)
treewide: Kill assignments in if conditions.
Somewhat hard to read and the code base already has many overlong lines. Found with below spatch file and some manual editing in ax25/access.c to restore a comment lost by spatch. @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 'tcpip/rip98r.c')
-rw-r--r--tcpip/rip98r.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/tcpip/rip98r.c b/tcpip/rip98r.c
index b1f283c..57afe4e 100644
--- a/tcpip/rip98r.c
+++ b/tcpip/rip98r.c
@@ -160,7 +160,8 @@ void receive_routes(int s)
case ADDITIONAL_ROUTE:
if (!found) {
- if ((new = malloc(sizeof(struct route_struct))) == NULL) {
+ new = malloc(sizeof(struct route_struct));
+ if (new == NULL) {
if (logging)
syslog(LOG_ERR, "out of memory\n");
return;
@@ -186,7 +187,8 @@ void receive_routes(int s)
}
if (!matched) {
- if ((new = malloc(sizeof(struct route_struct))) == NULL) {
+ new = malloc(sizeof(struct route_struct));
+ if (new == NULL) {
if (logging)
syslog(LOG_ERR, "out of memory\n");
return;