From d581eb798da1642c2a3bcb16dcb44fef4673c71e Mon Sep 17 00:00:00 2001 From: Lauri Kasanen Date: Mon, 11 Apr 2022 18:53:45 +0300 Subject: [PATCH] Use 64-bit var for the served file size --- common/network/websocket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/network/websocket.c b/common/network/websocket.c index 3de9a57..d2a725c 100644 --- a/common/network/websocket.c +++ b/common/network/websocket.c @@ -871,14 +871,14 @@ static void servefile(ws_ctx_t *ws_ctx, const char *in) { } fseek(f, 0, SEEK_END); - const unsigned filesize = ftell(f); + const uint64_t filesize = ftell(f); rewind(f); sprintf(buf, "HTTP/1.1 200 OK\r\n" "Server: KasmVNC/4.0\r\n" "Connection: close\r\n" "Content-type: %s\r\n" - "Content-length: %u\r\n" + "Content-length: %lu\r\n" "\r\n", name2mime(path), filesize); ws_send(ws_ctx, buf, strlen(buf));