netutils/webserver: Fix the compiler error when -no-builtin is removed
Error: httpd.c:671:7: error: 'strncpy' output truncated before terminating nul copying 12 bytes from a string of the same length [-Werror=stringop-truncation] 671 | strncpy(pstate->ht_filename, "/" CONFIG_NETUTILS_HTTPD_INDEX, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 672 | strlen("/" CONFIG_NETUTILS_HTTPD_INDEX)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
f0bb6cf914
commit
997379d14e
@ -668,8 +668,8 @@ static inline int httpd_parse(struct httpd_state *pstate)
|
|||||||
#ifdef CONFIG_NETUTILS_HTTPD_CLASSIC
|
#ifdef CONFIG_NETUTILS_HTTPD_CLASSIC
|
||||||
if (0 == strcmp(pstate->ht_filename, "/"))
|
if (0 == strcmp(pstate->ht_filename, "/"))
|
||||||
{
|
{
|
||||||
strncpy(pstate->ht_filename, "/" CONFIG_NETUTILS_HTTPD_INDEX,
|
strlcpy(pstate->ht_filename, "/" CONFIG_NETUTILS_HTTPD_INDEX,
|
||||||
strlen("/" CONFIG_NETUTILS_HTTPD_INDEX));
|
sizeof(pstate->ht_filename));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user