summaryrefslogtreecommitdiffstats
path: root/Modules/mmapmodule.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2000-04-10 21:34:37 (GMT)
committerGuido van Rossum <guido@python.org>2000-04-10 21:34:37 (GMT)
commit36d4f8b0ecc33a6ce09783bd39dea9a8b4c191a5 (patch)
tree82ae7d373ae6f2d02c8d64cacf5f3df915dbd7b8 /Modules/mmapmodule.c
parente110dcfa8600d58771c3553dba7e021b020ed98f (diff)
downloadcpython-36d4f8b0ecc33a6ce09783bd39dea9a8b4c191a5.zip
cpython-36d4f8b0ecc33a6ce09783bd39dea9a8b4c191a5.tar.gz
cpython-36d4f8b0ecc33a6ce09783bd39dea9a8b4c191a5.tar.bz2
Correct fix by Mark Favas for the cast problems.
Diffstat (limited to 'Modules/mmapmodule.c')
-rw-r--r--Modules/mmapmodule.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c
index 3fe1f1c..a79812d 100644
--- a/Modules/mmapmodule.c
+++ b/Modules/mmapmodule.c
@@ -116,9 +116,10 @@ mmap_read_byte_method (mmap_object * self,
PyObject * args)
{
char value;
- char * where = (self->data+self->pos);
+ char * where;
CHECK_VALID(NULL);
- if ((where >= (char *)0) && (where < (self->data+self->size))) {
+ if (self->pos >= 0 && self->pos < self->size) {
+ where = self->data + self->pos;
value = (char) *(where);
self->pos += 1;
return Py_BuildValue("c", (char) *(where));
@@ -593,7 +594,7 @@ mmap_ass_slice(self, ilow, ihigh, v)
int ilow, ihigh;
PyObject *v;
{
- unsigned char *buf;
+ const char *buf;
CHECK_VALID(-1);
if (ilow < 0)
@@ -628,7 +629,7 @@ mmap_ass_item(self, i, v)
int i;
PyObject *v;
{
- unsigned char *buf;
+ const char *buf;
CHECK_VALID(-1);
if (i < 0 || i >= self->size) {