summaryrefslogtreecommitdiffstats
path: root/Modules/mmapmodule.c
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2011-06-07 03:22:56 (GMT)
committerBrett Cannon <brett@python.org>2011-06-07 03:22:56 (GMT)
commit5fac8af22ce0fc18c19d02e4f08eaba144b77d07 (patch)
treec3a815996bc4dcade34cc3d57cf9cc49ebce5680 /Modules/mmapmodule.c
parenta0b1ff58447d27a4ab8f830f9ef69c75c70738e8 (diff)
downloadcpython-5fac8af22ce0fc18c19d02e4f08eaba144b77d07.zip
cpython-5fac8af22ce0fc18c19d02e4f08eaba144b77d07.tar.gz
cpython-5fac8af22ce0fc18c19d02e4f08eaba144b77d07.tar.bz2
Checking if an unsigned long is < 0 is pointless.
Found by LLVM/clang 2.9.
Diffstat (limited to 'Modules/mmapmodule.c')
-rw-r--r--Modules/mmapmodule.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c
index 36ca67d..38f6157 100644
--- a/Modules/mmapmodule.c
+++ b/Modules/mmapmodule.c
@@ -645,9 +645,9 @@ mmap_move_method(mmap_object *self, PyObject *args)
return NULL;
} else {
/* bounds check the values */
- if (cnt < 0 || (cnt + dest) < cnt || (cnt + src) < cnt ||
- src < 0 || src > self->size || (src + cnt) > self->size ||
- dest < 0 || dest > self->size || (dest + cnt) > self->size) {
+ if ((cnt + dest) < cnt || (cnt + src) < cnt ||
+ src > self->size || (src + cnt) > self->size ||
+ dest > self->size || (dest + cnt) > self->size) {
PyErr_SetString(PyExc_ValueError,
"source, destination, or count out of range");
return NULL;