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

This commit is contained in:
Hye-Shik Chang 2006-03-26 06:53:37 +00:00
parent 9f4b632212
commit 04904faac5
1 changed files with 4 additions and 4 deletions

View File

@ -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;