diff options
author | Michael W. Hudson <mwh@python.net> | 2002-03-18 12:43:33 (GMT) |
---|---|---|
committer | Michael W. Hudson <mwh@python.net> | 2002-03-18 12:43:33 (GMT) |
commit | 36de099f047a8a4c069bd06b1f5edd38d6e626ad (patch) | |
tree | fd25ac2d3cd866a5abde6d3b54f5aecab70b03f3 | |
parent | 54ad27ff6be05b0fc0882a3139fb62cd64ac6f09 (diff) | |
download | cpython-36de099f047a8a4c069bd06b1f5edd38d6e626ad.zip cpython-36de099f047a8a4c069bd06b1f5edd38d6e626ad.tar.gz cpython-36de099f047a8a4c069bd06b1f5edd38d6e626ad.tar.bz2 |
Fix
[ 531306 ] ucs4 build horked.
Classic C mistake, I think.
Also squashed a couple of warnings in the ucs4 build.
-rw-r--r-- | Objects/unicodeobject.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 576f97b..95ba361 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -1207,6 +1207,7 @@ PyObject *PyUnicode_EncodeUTF8(const Py_UNICODE *s, if (_PyString_Resize(&v, cbAllocated)) goto onError; p = PyString_AS_STRING(v) + (p - q); + q = PyString_AS_STRING(v); } /* combine the two values */ @@ -1232,6 +1233,7 @@ PyObject *PyUnicode_EncodeUTF8(const Py_UNICODE *s, if (_PyString_Resize(&v, cbAllocated)) goto onError; p = PyString_AS_STRING(v) + (p - q); + q = PyString_AS_STRING(v); } *p++ = 0xf0 | (ch>>18); @@ -1246,7 +1248,7 @@ PyObject *PyUnicode_EncodeUTF8(const Py_UNICODE *s, return v; onError: - Py_DECREF(v); + Py_XDECREF(v); return NULL; } @@ -5525,12 +5527,12 @@ PyObject *PyUnicode_Format(PyObject *format, break; default: - PyErr_Format(PyExc_ValueError, - "unsupported format character '%c' (0x%x) " - "at index %i", - (31<=c && c<=126) ? c : '?', - c, fmt -1 - PyUnicode_AS_UNICODE(uformat)); - goto onError; + PyErr_Format(PyExc_ValueError, + "unsupported format character '%c' (0x%x) " + "at index %i", + (31<=c && c<=126) ? (int)c : '?', + (int)c, (fmt -1 - PyUnicode_AS_UNICODE(uformat))); + goto onError; } if (sign) { if (*pbuf == '-' || *pbuf == '+') { |