diff Objects/unicodeobject.c @ 31455:37d501b9e2d5 legacy-trunk

Fix reallocation bug in unicode.translate(): The code was comparing characters instead of character pointers to determine space requirements.
author Walter Dörwald <walter@livinglogic.de>
date Thu, 05 Feb 2004 17:36:00 +0000
parents b4532c246a3a
children 227cb7402c6e
line wrap: on
line diff
--- a/Objects/unicodeobject.c	Wed Feb 04 23:14:14 2004 +0000
+++ b/Objects/unicodeobject.c	Thu Feb 05 17:36:00 2004 +0000
@@ -3283,7 +3283,7 @@
 	else if (repsize!=0) {
 	    /* more than one character */
 	    int requiredsize = (*outp-PyUnicode_AS_UNICODE(*outobj)) +
-		(insize - (*curinp-*startinp)) +
+		(insize - (curinp-startinp)) +
 		repsize - 1;
 	    if (charmaptranslate_makespace(outobj, outp, requiredsize))
 		return -1;