]> granicus.if.org Git - python/commitdiff
Support NFD of very long strings.
authorMartin v. Löwis <martin@v.loewis.de>
Thu, 13 Apr 2006 06:36:31 +0000 (06:36 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Thu, 13 Apr 2006 06:36:31 +0000 (06:36 +0000)
Modules/unicodedata.c

index faadf8836780945205237aa34f3076e093d5a814..1e4908fd9f07c749553610e24f54cdbb5640a57a 100644 (file)
@@ -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;