summaryrefslogtreecommitdiffstats
path: root/Modules/mmapmodule.c
diff options
context:
space:
mode:
authorHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2010-11-04 12:09:08 (GMT)
committerHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2010-11-04 12:09:08 (GMT)
commit3cdd5cb959672ce24dcf8132f3e9bbe27f908dc7 (patch)
tree0cae2e90e716369ea660d7e00d9ad266f0454970 /Modules/mmapmodule.c
parent95c0700effc69b6b41a4a4ca104ee6b65a42be23 (diff)
downloadcpython-3cdd5cb959672ce24dcf8132f3e9bbe27f908dc7.zip
cpython-3cdd5cb959672ce24dcf8132f3e9bbe27f908dc7.tar.gz
cpython-3cdd5cb959672ce24dcf8132f3e9bbe27f908dc7.tar.bz2
Issue #5391: mmap.read_byte() should return unsigned value [0, 255]
instead of signed value [-127, 128].
Diffstat (limited to 'Modules/mmapmodule.c')
-rw-r--r--Modules/mmapmodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c
index 680f1f1..13d7f55 100644
--- a/Modules/mmapmodule.c
+++ b/Modules/mmapmodule.c
@@ -204,7 +204,7 @@ mmap_read_byte_method(mmap_object *self,
if (self->pos < self->size) {
char value = self->data[self->pos];
self->pos += 1;
- return Py_BuildValue("b", value);
+ return Py_BuildValue("B", (unsigned char)value);
} else {
PyErr_SetString(PyExc_ValueError, "read byte out of range");
return NULL;