Using sizeof

This commit is contained in:
Indu Prakash
2022-11-06 19:08:39 -06:00
parent a5769a5db0
commit f7510a301e
3 changed files with 5 additions and 5 deletions

View File

@ -887,7 +887,7 @@ int http_fn_cfg_name(http_request_t* request) {
add_label_text_field(request, "ShortName", "shortName", CFG_GetShortDeviceName(), "<form action=\"/cfg_name\">");
char escapedDeviceName[256];
html_escape(CFG_GetDeviceName(), escapedDeviceName, 255);
html_escape(CFG_GetDeviceName(), escapedDeviceName, sizeof(escapedDeviceName));
add_label_text_field(request, "Full Name", "name", escapedDeviceName, "<br>");
poststr(request, "<br><br>");

View File

@ -250,7 +250,7 @@ void http_html_start(http_request_t* request, const char* pagename) {
poststr(request, "<head><title>");
char escapedDeviceName[256];
html_escape(CFG_GetDeviceName(), escapedDeviceName, 255);
html_escape(CFG_GetDeviceName(), escapedDeviceName, sizeof(escapedDeviceName));
poststr(request, escapedDeviceName);
if (pagename) {
@ -510,7 +510,7 @@ int hprintf255(http_request_t* request, const char* fmt, ...) {
va_list argList;
//BaseType_t taken;
char tmp[256];
memset(tmp, 0, 256);
memset(tmp, 0, sizeof(tmp));
va_start(argList, fmt);
vsnprintf(tmp, 255, fmt, argList);
va_end(argList);
@ -637,7 +637,7 @@ int HTTP_ProcessPacket(http_request_t* request) {
int method = callbacks[i]->method;
if (method == HTTP_ANY || method == request->method) {
return callbacks[i]->callback(request);
}
}
}
}
if (http_checkUrlBase(urlStr, "")) return http_fn_empty_url(request);

View File

@ -261,7 +261,7 @@ static int http_rest_app(http_request_t* request) {
poststr(request, htmlDoctype);
char escapedDeviceName[256];
html_escape(CFG_GetDeviceName(), escapedDeviceName, 255);
html_escape(CFG_GetDeviceName(), escapedDeviceName, sizeof(escapedDeviceName));
hprintf255(request, "<head><title>%s</title>", escapedDeviceName);
poststr(request, htmlShortcutIcon);