mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 08:19:52 +03:00
bufsize const in messagetime()
This commit is contained in:
@@ -156,13 +156,13 @@ void WebLogService::loop() {
|
||||
}
|
||||
|
||||
// convert time to real offset
|
||||
char * WebLogService::messagetime(char * out, const uint64_t t, size_t bufsize) {
|
||||
char * WebLogService::messagetime(char * out, const uint64_t t, const size_t bufsize) {
|
||||
if (!time_offset_) {
|
||||
strlcpy(out, uuid::log::format_timestamp_ms(t, 3).c_str(), bufsize);
|
||||
} else {
|
||||
time_t t1 = time_offset_ + t / 1000ULL;
|
||||
strftime(out, 25, "%F %T", localtime(&t1));
|
||||
snprintf(out, 25, "%s.%03d", out, (uint16_t)(t % 1000));
|
||||
strftime(out, bufsize, "%F %T", localtime(&t1));
|
||||
snprintf(out, bufsize, "%s.%03d", out, (uint16_t)(t % 1000));
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
@@ -62,9 +62,10 @@ class WebLogService : public uuid::log::Handler {
|
||||
void fetchLog(AsyncWebServerRequest * request);
|
||||
void getValues(AsyncWebServerRequest * request);
|
||||
|
||||
char * messagetime(char * out, const uint64_t t, size_t bufsize);
|
||||
char * messagetime(char * out, const uint64_t t, const size_t bufsize);
|
||||
|
||||
void setValues(AsyncWebServerRequest * request, JsonVariant & json);
|
||||
|
||||
AsyncCallbackJsonWebHandler setValues_; // for POSTs
|
||||
|
||||
uint64_t last_transmit_ = 0; // Last transmit time
|
||||
|
||||
Reference in New Issue
Block a user