This commit is contained in:
e2002
2022-11-18 14:01:35 +03:00
parent ef14938dbe
commit 0bb4272d8b
13 changed files with 65 additions and 68 deletions

View File

@@ -434,8 +434,8 @@ bool Config::parseSsid(const char* line, char* ssid, char* pass) {
tmpe = strstr(line, "\t");
if (tmpe == NULL) return false;
uint16_t pos = tmpe - line;
if (pos > 19 || strlen(line) > 61) return false;
memset(ssid, 0, 20);
if (pos > 29 || strlen(line) > 71) return false;
memset(ssid, 0, 30);
strlcpy(ssid, line, pos + 1);
memset(pass, 0, 40);
strlcpy(pass, line + pos + 1, strlen(line) - pos);
@@ -467,11 +467,11 @@ bool Config::initNetwork() {
if (!file || file.isDirectory()) {
return false;
}
char ssidval[20], passval[40];
char ssidval[30], passval[40];
byte c = 0;
while (file.available()) {
if (parseSsid(file.readStringUntil('\n').c_str(), ssidval, passval)) {
strlcpy(ssids[c].ssid, ssidval, 20);
strlcpy(ssids[c].ssid, ssidval, 30);
strlcpy(ssids[c].password, passval, 40);
ssidsCount++;
c++;

View File

@@ -123,7 +123,7 @@ struct station_t
struct neworkItem
{
char ssid[20];
char ssid[30];
char password[40];
};

View File

@@ -1,7 +1,7 @@
#ifndef options_h
#define options_h
#define VERSION "0.8.03b"
#define VERSION "0.8.089"
/*******************************************************
DO NOT EDIT THIS FILE.
@@ -264,6 +264,9 @@ The connection tables are located here https://github.com/e2002/yoradio#connecti
#endif
#define AUTOBACKLIGHT(x) ({uint16_t _lh=(x>AUTOBACKLIGHT_MAX?AUTOBACKLIGHT_MAX:x); map(_lh, AUTOBACKLIGHT_MAX, 0, AUTOBACKLIGHT_MIN, 100);}) // autobacklight function
#endif
#ifndef DSP_INVERT_TITLE
#define DSP_INVERT_TITLE true // Invert title colors for OLED displays ?
#endif
/*
*** ST7735 display submodel ***
INITR_BLACKTAB // 1.8' https://aliexpress.ru/item/1005002822797745.html

View File

@@ -422,7 +422,7 @@ void Telnet::on_input(const char* str, byte clientId) {
printf(clientId, "##WIFI.STATION#\n> ");
return;
}
char newssid[20], newpass[40];
char newssid[30], newpass[40];
if (sscanf(str, "wifi.con(\"%[^\"]\",\"%[^\"]\")", newssid, newpass) == 2 || sscanf(str, "wifi.con(%[^,],%[^)])", newssid, newpass) == 2 || sscanf(str, "wifi.con(%[^ ] %[^)])", newssid, newpass) == 2 || sscanf(str, "wifi %[^ ] %s", newssid, newpass) == 2) {
char buf[BUFLEN];
snprintf(buf, BUFLEN, "New SSID: \"%s\" with PASS: \"%s\" for next boot\n> ", newssid, newpass);