mirror of
https://github.com/openshwprojects/OpenBK7231T_App.git
synced 2026-02-14 23:35:35 +00:00
Using sizeof
This commit is contained in:
@ -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>");
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user