]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: spoa-server: fix size_t format printing
authorWilliam Dauchy <w.dauchy@criteo.com>
Sat, 1 Aug 2020 14:28:51 +0000 (16:28 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 5 Aug 2020 20:12:47 +0000 (22:12 +0200)
From https://www.python.org/dev/peps/pep-0353/
"A new type Py_ssize_t is introduced, which has the same size as the
compiler's size_t type, but is signed. It will be a typedef for ssize_t
where available."

For integer types, causes printf to expect a size_t-sized integer
argument.

This should fix github issue #702

This should be backported to >= v2.2

Signed-off-by: William Dauchy <w.dauchy@criteo.com>
contrib/spoa_server/ps_python.c

index 00cb0e30db6939d7ab1a10802bf8beab19755321..be6fc4b7eb6223c12c137997cf4df9c21704e598 100644 (file)
@@ -66,7 +66,7 @@ static int ps_python_check_overflow(Py_ssize_t len)
         */
        if (len >= (Py_ssize_t)INT_MAX) {
                PyErr_Format(spoa_error,
-                               "%d is over 2GB. Please split in smaller pieces.", \
+                               "%zd is over 2GB. Please split in smaller pieces.", \
                                len);
                return -1;
        } else {