Skip to content

Commit 1e995c6

Browse files
committed
samples: http_server: Fix warning about integer name
When building with CONFIG_DEBUG=y, there is a build warning about the name being truncated due to integer size is larger than MAX_NAME_LEN. So fix MAX_NAME_LEN to be large enough to handle 10 digit integer, which is maximum. Signed-off-by: Declan Snyder <[email protected]>
1 parent 31ef45e commit 1e995c6

File tree

1 file changed

+1
-1
lines changed
  • samples/net/sockets/http_server/src

1 file changed

+1
-1
lines changed

samples/net/sockets/http_server/src/ws.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ int ws_echo_setup(int ws_socket, struct http_request_ctx *request_ctx, void *use
321321
K_NO_WAIT);
322322

323323
if (IS_ENABLED(CONFIG_THREAD_NAME)) {
324-
#define MAX_NAME_LEN sizeof("ws[xx]")
324+
#define MAX_NAME_LEN (sizeof("ws[]") + 10)
325325
char name[MAX_NAME_LEN];
326326

327327
snprintk(name, sizeof(name), "ws[%d]", slot);

0 commit comments

Comments
 (0)