From e35d1d4f4222a6aff0189b02c2c3567e8542bb20 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Tue, 11 Feb 2020 10:58:56 +0100 Subject: [PATCH] BUILD: http_act: cast file sizes when reporting file size error As seen in issue #496, st_size may be of varying types on different systems. Let's simply cast it to long long and use long long for all size outputs. --- src/http_act.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/http_act.c b/src/http_act.c index a3dce68b9..4c0c5c406 100644 --- a/src/http_act.c +++ b/src/http_act.c @@ -2134,8 +2134,8 @@ static enum act_parse_ret parse_http_return(const char **args, int *orig_arg, st goto error; } if (stat.st_size > global.tune.bufsize) { - memprintf(err, "file '%s' exceeds the buffer size (%ld > %d)", - args[cur_arg], stat.st_size, global.tune.bufsize); + memprintf(err, "file '%s' exceeds the buffer size (%lld > %d)", + args[cur_arg], (long long)stat.st_size, global.tune.bufsize); goto error; } objlen = stat.st_size; @@ -2183,8 +2183,8 @@ static enum act_parse_ret parse_http_return(const char **args, int *orig_arg, st goto error; } if (stat.st_size > global.tune.bufsize) { - memprintf(err, "file '%s' exceeds the buffer size (%ld > %d)", - args[cur_arg], stat.st_size, global.tune.bufsize); + memprintf(err, "file '%s' exceeds the buffer size (%lld > %d)", + args[cur_arg], (long long)stat.st_size, global.tune.bufsize); goto error; } objlen = stat.st_size;