summaryrefslogtreecommitdiff
path: root/Modules/_tkinter.c
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-06-12 02:06:42 +0000
committerNeal Norwitz <nnorwitz@gmail.com>2006-06-12 02:06:42 +0000
commit047f3c7ffad1eb30e8b5345d665e3e96062cbd5d (patch)
tree6f5eb8499bfeb47d3e050c9ae052117f457ff4d0 /Modules/_tkinter.c
parentc7074386b41c4d38c6e11f614dacb55a312cde42 (diff)
downloadcpython-git-047f3c7ffad1eb30e8b5345d665e3e96062cbd5d.tar.gz
Fix some Py_ssize_t issues
Diffstat (limited to 'Modules/_tkinter.c')
-rw-r--r--Modules/_tkinter.c5
1 files changed, 3 insertions, 2 deletions
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();