]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: http_act: cast file sizes when reporting file size error
authorWilly Tarreau <w@1wt.eu>
Tue, 11 Feb 2020 09:58:56 +0000 (10:58 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 11 Feb 2020 09:58:56 +0000 (10:58 +0100)
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

index a3dce68b909380da2720428381ae86203fb90f45..4c0c5c4066e1679316091118e17784e52ca596b8 100644 (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;