From: Tim Peters Date: Sun, 21 Apr 2002 03:26:37 +0000 (+0000) Subject: PyUnicode_EncodeUTF8: squash compiler wng. The difference of two X-Git-Tag: v2.3c1~5858 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7e3d961fc15e3e7fd5846e31bdfd3fc8df19edec;p=python 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. --- diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index abaa67c5c5..a4d455ad72 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 */