mirror of https://github.com/python/cpython
Utilize %zd for Py_ssize_t formatting instead of casting to long.
This commit is contained in:
parent
9f4b632212
commit
04904faac5
|
@ -334,8 +334,8 @@ multibytecodec_encerror(MultibyteCodec *codec,
|
||||||
if (newpos < 0 || buf->inbuf_top + newpos > buf->inbuf_end) {
|
if (newpos < 0 || buf->inbuf_top + newpos > buf->inbuf_end) {
|
||||||
PyErr_Clear();
|
PyErr_Clear();
|
||||||
PyErr_Format(PyExc_IndexError,
|
PyErr_Format(PyExc_IndexError,
|
||||||
"position %ld from error handler out of bounds",
|
"position %zd from error handler out of bounds",
|
||||||
(long)newpos);
|
newpos);
|
||||||
goto errorexit;
|
goto errorexit;
|
||||||
}
|
}
|
||||||
buf->inbuf = buf->inbuf_top + newpos;
|
buf->inbuf = buf->inbuf_top + newpos;
|
||||||
|
@ -445,8 +445,8 @@ multibytecodec_decerror(MultibyteCodec *codec,
|
||||||
if (newpos < 0 || buf->inbuf_top + newpos > buf->inbuf_end) {
|
if (newpos < 0 || buf->inbuf_top + newpos > buf->inbuf_end) {
|
||||||
PyErr_Clear();
|
PyErr_Clear();
|
||||||
PyErr_Format(PyExc_IndexError,
|
PyErr_Format(PyExc_IndexError,
|
||||||
"position %ld from error handler out of bounds",
|
"position %zd from error handler out of bounds",
|
||||||
(long)newpos);
|
newpos);
|
||||||
goto errorexit;
|
goto errorexit;
|
||||||
}
|
}
|
||||||
buf->inbuf = buf->inbuf_top + newpos;
|
buf->inbuf = buf->inbuf_top + newpos;
|
||||||
|
|
Loading…
Reference in New Issue