From c8c1426c682325586e20c763dee3ec71c9ca4bff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20K=C3=BChndel?= Date: Tue, 6 Oct 2020 15:01:31 +0200 Subject: mghttpd/mongoose: Fix string truncation warning This fixes the compiler warning below. ../../../cpukit/mghttpd/mongoose.c:1919:45: warning: '.gz' directive output may be truncated writing 3 bytes into a region of size between 1 and 255 [-Wformat-truncation=] --- cpukit/mghttpd/mongoose.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpukit/mghttpd/mongoose.c b/cpukit/mghttpd/mongoose.c index fb2bce7471..0736c836ec 100644 --- a/cpukit/mghttpd/mongoose.c +++ b/cpukit/mghttpd/mongoose.c @@ -1887,7 +1887,7 @@ static void convert_uri_to_file_name(struct mg_connection *conn, char *buf, *root = conn->ctx->config[DOCUMENT_ROOT]; char *p; int match_len; - char gz_path[PATH_MAX]; + char gz_path[PATH_MAX + 3]; char const* accept_encoding; // Using buf_len - 1 because memmove() for PATH_INFO may shift part @@ -3021,7 +3021,7 @@ static void handle_file_request(struct mg_connection *conn, const char *path, int64_t cl, r1, r2; struct vec mime_vec; int n; - char gz_path[PATH_MAX]; + char gz_path[PATH_MAX + 3]; char const* encoding = ""; get_mime_type(conn->ctx, path, &mime_vec); -- cgit v1.2.3