Commits

Ronald Oussoren committed a857f46

Merged revisions 2592 via svnmerge from
https://svn.red-bean.com/pyobjc/trunk/pyobjc

........
r2592 | ronaldoussoren | 2010-09-08 17:09:30 +0200 (Wed, 08 Sep 2010) | 3 lines

Ensure that the pyobjc_unicode's internal storage is NUL terminated,
some C extensions expect them to be.
........

Comments (0)

Files changed (1)

pyobjc-core/Modules/objc/unicode-object.m

 	 *  		NSArray.alloc().init()
 	 */
 	PyObjCUnicodeObject* result;
-// XXX - I don't know how to get gcc to let me use sizeof(unichar)
+
 #ifdef PyObjC_UNICODE_FAST_PATH
 	Py_ssize_t length = [value length];
 
 	}
 	result = PyObject_New(PyObjCUnicodeObject, &PyObjCUnicode_Type);
 	Py_UNICODE* tptr = PyObject_MALLOC(sizeof(Py_UNICODE) * (length+1));
+	tptr[0] = tptr[length] = 0;
 	result->base.str = tptr;
 	/*PyUnicode_AS_UNICODE(result) = tptr;*/
 	tptr = NULL;