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.
This commit is contained in:
Willy Tarreau 2020-02-11 10:58:56 +01:00
parent 160ad9e38a
commit e35d1d4f42

View File

@ -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;