From: Willy Tarreau Date: Tue, 11 Feb 2020 09:58:56 +0000 (+0100) Subject: BUILD: http_act: cast file sizes when reporting file size error X-Git-Tag: v2.2-dev3~88 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e35d1d4f4222a6aff0189b02c2c3567e8542bb20;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/src/http_act.c b/src/http_act.c index a3dce68b90..4c0c5c4066 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;