]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wpa_gui: Silence a compiler warning
authorJouni Malinen <j@w1.fi>
Fri, 27 Dec 2019 22:17:55 +0000 (00:17 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 27 Dec 2019 22:17:55 +0000 (00:17 +0200)
Signed-off-by: Jouni Malinen <j@w1.fi>
wpa_supplicant/wpa_gui-qt4/peers.cpp

index 3bcf2f51d37fb5cfcd4b5c914b6c871ff1be880d..0a0b3ffcb51b6dd10c68578d60f25e370ba9d81c 100644 (file)
@@ -476,7 +476,9 @@ void Peers::add_stations()
                add_station(info);
 
                reply_len = sizeof(reply) - 1;
-               snprintf(cmd, sizeof(cmd), "STA-NEXT %s", reply);
+               res = snprintf(cmd, sizeof(cmd), "STA-NEXT %s", reply);
+               if (res < 0 || (size_t) res >= sizeof(cmd))
+                       break;
                res = wpagui->ctrlRequest(cmd, reply, &reply_len);
        } while (res >= 0);
 }