diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2006-04-13 06:36:31 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2006-04-13 06:36:31 (GMT) |
commit | 3c6e4188ed32da96455fe12893d317751721ce48 (patch) | |
tree | 2190688694bf046d56394018bb769c2a6641ca6f | |
parent | 07c60717296ab8228b4a4e46d5e6fb163965a181 (diff) | |
download | cpython-3c6e4188ed32da96455fe12893d317751721ce48.zip cpython-3c6e4188ed32da96455fe12893d317751721ce48.tar.gz cpython-3c6e4188ed32da96455fe12893d317751721ce48.tar.bz2 |
Support NFD of very long strings.
-rw-r--r-- | Modules/unicodedata.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/unicodedata.c b/Modules/unicodedata.c index faadf88..1e4908f 100644 --- a/Modules/unicodedata.c +++ b/Modules/unicodedata.c @@ -486,8 +486,8 @@ nfd_nfkd(PyObject *self, PyObject *input, int k) Py_UNICODE *i, *end, *o; /* Longest decomposition in Unicode 3.2: U+FDFA */ Py_UNICODE stack[20]; - int space, stackptr, isize; - int index, prefix, count; + Py_ssize_t space, isize; + int index, prefix, count, stackptr; unsigned char prev, cur; stackptr = 0; @@ -508,7 +508,7 @@ nfd_nfkd(PyObject *self, PyObject *input, int k) /* Hangul Decomposition adds three characters in a single step, so we need atleast that much room. */ if (space < 3) { - int newsize = PyString_GET_SIZE(result) + 10; + Py_ssize_t newsize = PyString_GET_SIZE(result) + 10; space += 10; if (PyUnicode_Resize(&result, newsize) == -1) return NULL; |