diff options
author | Tim Peters <tim.peters@gmail.com> | 2002-04-21 03:26:37 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2002-04-21 03:26:37 (GMT) |
commit | 7e3d961fc15e3e7fd5846e31bdfd3fc8df19edec (patch) | |
tree | 9509455b71c5db57dc0e8f0143c503be0391b4db /Objects/unicodeobject.c | |
parent | dc374e034a56069818b0f1c8e360144520f8da98 (diff) | |
download | cpython-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.c | 9 |
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 */ |