Power monitor - added configurable history model

Fixed bug: missing call of BL_stared_init
Fixed bug: htprintf128 change to vsnprintf with buffer limit set to 256 bytes
This commit is contained in:
valeklubomir
2022-10-16 16:51:06 +02:00
parent f43d67f7d7
commit 2e00165225
7 changed files with 214 additions and 73 deletions

View File

@ -425,7 +425,7 @@ int hprintf128(http_request_t* request, const char* fmt, ...) {
//BaseType_t taken;
char tmp[256];
va_start(argList, fmt);
vsprintf(tmp, fmt, argList);
vsnprintf(tmp, 255, fmt, argList);
va_end(argList);
return postany(request, tmp, strlen(tmp));
}
@ -616,4 +616,4 @@ const char pageScript[] = "<script type='text/javascript'>var firstTime,lastTime
//region_start ha_discovery_script
const char ha_discovery_script[] = "<script type='text/javascript'>function send_ha_disc(){var e=new XMLHttpRequest;e.open(\"GET\",\"/ha_discovery?prefix=\"+document.getElementById(\"ha_disc_topic\").value,!1),e.onload=function(){200===e.status?alert(e.responseText):404===e.status&&alert(\"Error invoking ha_discovery\")},e.onerror=function(){alert(\"Error invoking ha_discovery\")},e.send()}</script>";
//region_end ha_discovery_script
//region_end ha_discovery_script