]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #18672: Fixed format specifiers for Py_ssize_t in debugging output in
authorSerhiy Storchaka <storchaka@gmail.com>
Thu, 5 Sep 2013 15:02:31 +0000 (18:02 +0300)
committerSerhiy Storchaka <storchaka@gmail.com>
Thu, 5 Sep 2013 15:02:31 +0000 (18:02 +0300)
the _sre moduel.

1  2 
Misc/NEWS
Modules/_sre.c

diff --cc Misc/NEWS
Simple merge
diff --cc Modules/_sre.c
index e10bb9565bfa61a967b47ee8913609aa4ca77ef3,5bcc387977aec5aec2e5c473871f5672071ee10a..99c3cd5c05f9cc8dc13d9bdfa4f44f1368917f82
@@@ -795,9 -804,11 +800,11 @@@ entrance
      if (ctx->pattern[0] == SRE_OP_INFO) {
          /* optimization info block */
          /* <INFO> <1=skip> <2=flags> <3=min> ... */
 -        if (ctx->pattern[3] && (end - ctx->ptr)/state->charsize < ctx->pattern[3]) {
 +        if (ctx->pattern[3] && (Py_uintptr_t)(end - ctx->ptr)/state->charsize < ctx->pattern[3]) {
-             TRACE(("reject (got %d chars, need %d)\n",
-                    (end - ctx->ptr)/state->charsize, ctx->pattern[3]));
+             TRACE(("reject (got %" PY_FORMAT_SIZE_T "d chars, "
+                    "need %" PY_FORMAT_SIZE_T "d)\n",
+                    (end - ctx->ptr)/state->charsize,
+                    (Py_ssize_t) ctx->pattern[3]));
              RETURN_FAILURE;
          }
          ctx->pattern += ctx->pattern[1] + 1;