mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
coverity: 37468: confirm gethostname worked
This commit is contained in:
parent
d69b91d2d9
commit
258ee1886f
1 changed files with 4 additions and 2 deletions
|
@ -3071,8 +3071,10 @@ lws_server_get_canonical_hostname(struct lws_context *context,
|
|||
return;
|
||||
#if !defined(LWS_PLAT_FREERTOS)
|
||||
/* find canonical hostname */
|
||||
gethostname((char *)context->canonical_hostname,
|
||||
sizeof(context->canonical_hostname) - 1);
|
||||
if (gethostname((char *)context->canonical_hostname,
|
||||
sizeof(context->canonical_hostname) - 1))
|
||||
lws_strncpy((char *)context->canonical_hostname, "unknown",
|
||||
sizeof(context->canonical_hostname));
|
||||
|
||||
lwsl_info(" canonical_hostname = %s\n", context->canonical_hostname);
|
||||
#else
|
||||
|
|
Loading…
Add table
Reference in a new issue