]> granicus.if.org Git - python/commitdiff
PyUnicode_EncodeUTF8: squash compiler wng. The difference of two
authorTim Peters <tim.peters@gmail.com>
Sun, 21 Apr 2002 03:26:37 +0000 (03:26 +0000)
committerTim Peters <tim.peters@gmail.com>
Sun, 21 Apr 2002 03:26:37 +0000 (03:26 +0000)
pointers is a signed type.  Changing "allocated" to a signed int makes
undetected overflow more likely, but there was no overflow detection
before either.

Objects/unicodeobject.c

index abaa67c5c5f07ab127ed82863ce63d8889bb38cc..a4d455ad72e40f188abd8a2097150c9256e11e7b 100644 (file)
@@ -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 */