summaryrefslogtreecommitdiffstats
path: root/Objects/unicodeobject.c
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2002-04-21 03:26:37 (GMT)
committerTim Peters <tim.peters@gmail.com>2002-04-21 03:26:37 (GMT)
commit7e3d961fc15e3e7fd5846e31bdfd3fc8df19edec (patch)
tree9509455b71c5db57dc0e8f0143c503be0391b4db /Objects/unicodeobject.c
parentdc374e034a56069818b0f1c8e360144520f8da98 (diff)
downloadcpython-7e3d961fc15e3e7fd5846e31bdfd3fc8df19edec.zip
cpython-7e3d961fc15e3e7fd5846e31bdfd3fc8df19edec.tar.gz
cpython-7e3d961fc15e3e7fd5846e31bdfd3fc8df19edec.tar.bz2
PyUnicode_EncodeUTF8: squash compiler wng. The difference of two
pointers is a signed type. Changing "allocated" to a signed int makes undetected overflow more likely, but there was no overflow detection before either.
Diffstat (limited to 'Objects/unicodeobject.c')
-rw-r--r--Objects/unicodeobject.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index abaa67c..a4d455a 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -1172,13 +1172,14 @@ int utf8_encoding_error(const Py_UNICODE **source,
}
#endif
-PyObject *PyUnicode_EncodeUTF8(const Py_UNICODE *s,
- int size,
- const char *errors)
+PyObject *
+PyUnicode_EncodeUTF8(const Py_UNICODE *s,
+ int size,
+ const char *errors)
{
PyObject *v;
char *p;
- unsigned int allocated = 0;
+ int allocated = 0;
int i;
/* Short-cut for emtpy strings */