Commit 04904faa authored by Hye-Shik Chang's avatar Hye-Shik Chang

Utilize %zd for Py_ssize_t formatting instead of casting to long.

parent 9f4b6322
......@@ -334,8 +334,8 @@ multibytecodec_encerror(MultibyteCodec *codec,
if (newpos < 0 || buf->inbuf_top + newpos > buf->inbuf_end) {
PyErr_Clear();
PyErr_Format(PyExc_IndexError,
"position %ld from error handler out of bounds",
(long)newpos);
"position %zd from error handler out of bounds",
newpos);
goto errorexit;
}
buf->inbuf = buf->inbuf_top + newpos;
......@@ -445,8 +445,8 @@ multibytecodec_decerror(MultibyteCodec *codec,
if (newpos < 0 || buf->inbuf_top + newpos > buf->inbuf_end) {
PyErr_Clear();
PyErr_Format(PyExc_IndexError,
"position %ld from error handler out of bounds",
(long)newpos);
"position %zd from error handler out of bounds",
newpos);
goto errorexit;
}
buf->inbuf = buf->inbuf_top + newpos;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment