Merge pull request #10758 from gemu2015/filemanager

fix ip crashes
This commit is contained in:
Theo Arends 2021-01-30 10:21:57 +01:00 committed by GitHub
commit 75c6cbb45c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -1045,7 +1045,7 @@ void DisplayLogBufferInit(void)
DisplayLogBufferAdd(buffer); DisplayLogBufferAdd(buffer);
snprintf_P(buffer, sizeof(buffer), PSTR(D_JSON_MAC " %s"), NetworkMacAddress().c_str()); snprintf_P(buffer, sizeof(buffer), PSTR(D_JSON_MAC " %s"), NetworkMacAddress().c_str());
DisplayLogBufferAdd(buffer); DisplayLogBufferAdd(buffer);
snprintf_P(buffer, sizeof(buffer), PSTR("IP %_I"), (uint32_t)NetworkAddress()); ext_snprintf_P(buffer, sizeof(buffer), PSTR("IP %_I"), (uint32_t)NetworkAddress());
DisplayLogBufferAdd(buffer); DisplayLogBufferAdd(buffer);
if (!TasmotaGlobal.global_state.wifi_down) { if (!TasmotaGlobal.global_state.wifi_down) {
snprintf_P(buffer, sizeof(buffer), PSTR(D_JSON_SSID " %s"), SettingsText(SET_STASSID1 + Settings.sta_active)); snprintf_P(buffer, sizeof(buffer), PSTR(D_JSON_SSID " %s"), SettingsText(SET_STASSID1 + Settings.sta_active));

View File

@ -562,7 +562,7 @@ void UfsListDir(char *path, uint8_t depth) {
sprintf(cp, format, ep); sprintf(cp, format, ep);
if (entry.isDirectory()) { if (entry.isDirectory()) {
snprintf_P(npath, sizeof(npath), UFS_FORM_SDC_HREF, (uint32_t)WiFi.localIP(), pp, ep); ext_snprintf_P(npath, sizeof(npath), UFS_FORM_SDC_HREF, (uint32_t)WiFi.localIP(), pp, ep);
WSContentSend_P(UFS_FORM_SDC_DIRd, npath, ep, name); WSContentSend_P(UFS_FORM_SDC_DIRd, npath, ep, name);
uint8_t plen = strlen(path); uint8_t plen = strlen(path);
if (plen > 1) { if (plen > 1) {
@ -574,12 +574,12 @@ void UfsListDir(char *path, uint8_t depth) {
} else { } else {
#ifdef GUI_TRASH_FILE #ifdef GUI_TRASH_FILE
char delpath[128]; char delpath[128];
snprintf_P(delpath, sizeof(delpath), UFS_FORM_SDC_HREFdel, (uint32_t)WiFi.localIP(), pp, ep); ext_snprintf_P(delpath, sizeof(delpath), UFS_FORM_SDC_HREFdel, (uint32_t)WiFi.localIP(), pp, ep);
#else #else
char delpath[2]; char delpath[2];
delpath[0]=0; delpath[0]=0;
#endif // GUI_TRASH_FILE #endif // GUI_TRASH_FILE
snprintf_P(npath, sizeof(npath), UFS_FORM_SDC_HREF, (uint32_t)WiFi.localIP(), pp, ep); ext_snprintf_P(npath, sizeof(npath), UFS_FORM_SDC_HREF, (uint32_t)WiFi.localIP(), pp, ep);
WSContentSend_P(UFS_FORM_SDC_DIRb, npath, ep, name, tstr.c_str(), entry.size(), delpath); WSContentSend_P(UFS_FORM_SDC_DIRb, npath, ep, name, tstr.c_str(), entry.size(), delpath);
} }
} }