From 047f3c7ffad1eb30e8b5345d665e3e96062cbd5d Mon Sep 17 00:00:00 2001 From: Neal Norwitz Date: Mon, 12 Jun 2006 02:06:42 +0000 Subject: Fix some Py_ssize_t issues --- Modules/_tkinter.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Modules/_tkinter.c') diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c index 0f6382efc7..ee9a633692 100644 --- a/Modules/_tkinter.c +++ b/Modules/_tkinter.c @@ -932,12 +932,13 @@ AsObj(PyObject *value) #ifdef Py_USING_UNICODE else if (PyUnicode_Check(value)) { Py_UNICODE *inbuf = PyUnicode_AS_UNICODE(value); - int size = PyUnicode_GET_SIZE(value); + Py_ssize_t size = PyUnicode_GET_SIZE(value); /* This #ifdef assumes that Tcl uses UCS-2. See TCL_UTF_MAX test above. */ #if defined(Py_UNICODE_WIDE) && TCL_UTF_MAX == 3 Tcl_UniChar *outbuf; - int i; + Py_ssize_t i; + assert(size < size * sizeof(Tcl_UniChar)); outbuf = (Tcl_UniChar*)ckalloc(size * sizeof(Tcl_UniChar)); if (!outbuf) { PyErr_NoMemory(); -- cgit v1.2.1