Skip to content

Commit bf0c0ef

Browse files
committed
wifi: mode: fix extra parameter bug
1 parent 07c890e commit bf0c0ef

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

CompostaUSBBridge/cmds_wifi_station.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,12 @@ void CAtHandler::add_cmds_wifi_station() {
227227
}
228228
}
229229

230-
auto &auto_Conn = parser.args[1];
231-
if (!auto_Conn.empty()) {
232-
bool autoconn = atoi(auto_Conn.c_str());
233-
WiFi.setAutoConnect(autoconn);
230+
if (parser.args.size() == 2) {
231+
auto &auto_Conn = parser.args[1];
232+
if (!auto_Conn.empty()) {
233+
bool autoconn = atoi(auto_Conn.c_str());
234+
WiFi.setAutoConnect(autoconn);
235+
}
234236
}
235237
srv.write_response_prompt();
236238
srv.write_line_end();

0 commit comments

Comments
 (0)