diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2009-10-14 17:18:54 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2009-10-14 17:18:54 (GMT) |
commit | 96bb15bcb46b5e7cb3cd9ec62b8d2039e4ec7057 (patch) | |
tree | ba8d6fc99fb55f2133584a1d1cb0a4086eb0fbd6 /Objects | |
parent | af4ea65a3a7d97531fd79721dedf89564d6ed11a (diff) | |
download | cpython-96bb15bcb46b5e7cb3cd9ec62b8d2039e4ec7057.zip cpython-96bb15bcb46b5e7cb3cd9ec62b8d2039e4ec7057.tar.gz cpython-96bb15bcb46b5e7cb3cd9ec62b8d2039e4ec7057.tar.bz2 |
Merged revisions 75404 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r75404 | antoine.pitrou | 2009-10-14 19:14:16 +0200 (mer., 14 oct. 2009) | 5 lines
Issue #7065: Fix a crash in bytes.maketrans and bytearray.maketrans when
using byte values greater than 127. Patch by egreen.
........
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/bytes_methods.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/bytes_methods.c b/Objects/bytes_methods.c index 3bac2d1..6908eb8 100644 --- a/Objects/bytes_methods.c +++ b/Objects/bytes_methods.c @@ -427,7 +427,7 @@ _Py_bytes_maketrans(PyObject *args) { PyObject *frm, *to, *res = NULL; Py_buffer bfrm, bto; - int i; + Py_ssize_t i; char *p; bfrm.len = -1; @@ -452,7 +452,7 @@ _Py_bytes_maketrans(PyObject *args) for (i = 0; i < 256; i++) p[i] = i; for (i = 0; i < bfrm.len; i++) { - p[(int)((char *)bfrm.buf)[i]] = ((char *)bto.buf)[i]; + p[((unsigned char *)bfrm.buf)[i]] = ((char *)bto.buf)[i]; } done: |