]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
rearrange some tests to be clearer
authorJohannes Berg <johannes@sipsolutions.net>
Mon, 4 May 2009 12:32:24 +0000 (14:32 +0200)
committerJohannes Berg <johannes@sipsolutions.net>
Mon, 4 May 2009 12:32:24 +0000 (14:32 +0200)
scan.c

diff --git a/scan.c b/scan.c
index 4d94e45b5217556414e872263ac9cd1057e1b643..9b58c298d388b98de7740224146b6202e97db6a6 100644 (file)
--- a/scan.c
+++ b/scan.c
@@ -63,15 +63,15 @@ static int handle_scan(struct nl80211_state *state,
        }
 
        for (i = 0; i < argc; i++) {
-               if (strcmp(argv[i], "freq") == 0 && parse == NONE) {
+               if (parse == NONE && strcmp(argv[i], "freq") == 0) {
                        parse = FREQ;
                        have_freqs = true;
                        continue;
-               } else if (strcmp(argv[i], "ssid") == 0 && parse < SSID) {
+               } else if (parse < SSID && strcmp(argv[i], "ssid") == 0) {
                        parse = SSID;
                        have_ssids = true;
                        continue;
-               } else if (strcmp(argv[i], "passive") == 0 && parse < SSID) {
+               } else if (parse < SSID && strcmp(argv[i], "passive") == 0) {
                        parse = DONE;
                        passive = true;
                        continue;