Discussion:
[Python-checkins] cpython (3.3): Fixed signed/unsigned comparison warning
benjamin.peterson
2014-10-16 04:03:40 UTC
Permalink
https://hg.python.org/cpython/rev/b4a6be12a4bc
changeset: 93091:b4a6be12a4bc
branch: 3.3
parent: 93079:cda907a02a80
user: Antoine Pitrou <solipsis at pitrou.net>
date: Wed Oct 15 23:14:53 2014 +0200
summary:
Fixed signed/unsigned comparison warning

files:
Objects/unicodeobject.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -9484,7 +9484,7 @@
kind = PyUnicode_KIND(self);
data = PyUnicode_DATA(self);
length = PyUnicode_GET_LENGTH(self);
- if (length > PY_SSIZE_T_MAX / (3 * sizeof(Py_UCS4))) {
+ if ((size_t) length > PY_SSIZE_T_MAX / (3 * sizeof(Py_UCS4))) {
PyErr_SetString(PyExc_OverflowError, "string is too long");
return NULL;
}
--
Repository URL: https://hg.python.org/cpython
Loading...