[Olsr-dev] [PATCH v1 04/44] txtinfo: simplify some string comparisons
Ferry Huberts
(spam-protected)
Fri Nov 27 10:42:57 CET 2015
From: Ferry Huberts <(spam-protected)>
Signed-off-by: Ferry Huberts <(spam-protected)>
---
lib/txtinfo/src/olsrd_txtinfo.c | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/lib/txtinfo/src/olsrd_txtinfo.c b/lib/txtinfo/src/olsrd_txtinfo.c
index c394db9..94060ad 100644
--- a/lib/txtinfo/src/olsrd_txtinfo.c
+++ b/lib/txtinfo/src/olsrd_txtinfo.c
@@ -318,38 +318,38 @@ static void ipc_action(int fd, void *data __attribute__ ((unused)), unsigned int
* page the normal output is somewhat lengthy. The
* header parsing is sufficient for standard wget.
*/
- if (0 != strstr(requ, "/neighbours"))
+ if (strstr(requ, "/neighbours"))
send_what = SIW_NEIGH | SIW_LINK;
else {
/* print out every combinations of requested tabled
* 3++ letter abbreviations are matched */
- if (0 != strstr(requ, "/all"))
+ if (strstr(requ, "/all"))
send_what = SIW_ALL;
else { /*already included in /all*/
- if (0 != strstr(requ, "/nei"))
+ if (strstr(requ, "/nei"))
send_what |= SIW_NEIGH;
- if (0 != strstr(requ, "/lin"))
+ if (strstr(requ, "/lin"))
send_what |= SIW_LINK;
- if (0 != strstr(requ, "/rou"))
+ if (strstr(requ, "/rou"))
send_what |= SIW_ROUTE;
- if (0 != strstr(requ, "/hna"))
+ if (strstr(requ, "/hna"))
send_what |= SIW_HNA;
- if (0 != strstr(requ, "/mid"))
+ if (strstr(requ, "/mid"))
send_what |= SIW_MID;
- if (0 != strstr(requ, "/top"))
+ if (strstr(requ, "/top"))
send_what |= SIW_TOPO;
}
- if (0 != strstr(requ, "/gat"))
+ if (strstr(requ, "/gat"))
send_what |= SIW_GATEWAY;
- if (0 != strstr(requ, "/con"))
+ if (strstr(requ, "/con"))
send_what |= SIW_CONFIG;
- if (0 != strstr(requ, "/int"))
+ if (strstr(requ, "/int"))
send_what |= SIW_INTERFACE;
- if (0 != strstr(requ, "/2ho"))
+ if (strstr(requ, "/2ho"))
send_what |= SIW_2HOP;
- if (0 != strstr(requ, "/ver"))
+ if (strstr(requ, "/ver"))
send_what |= SIW_VERSION;
- if (0 != strstr(requ, "/sgw"))
+ if (strstr(requ, "/sgw"))
send_what |= SIW_SGW;
}
}
--
2.5.0
More information about the Olsr-dev
mailing list