diff Objects/complexobject.c @ 23124:0ba23341e5cf 2.2

backport tim_one's patch: SF bug 543840: complex(string) accepts strings with \0 complex_subtype_from_string(): this stopped parsing at the first 0 byte, as if that were the end of the input string.
author Anthony Baxter <anthonybaxter@gmail.com>
date Thu, 18 Apr 2002 02:19:46 +0000
parents 75ef1f16725e
children c4609ca17e3e
line wrap: on
line diff
--- a/Objects/complexobject.c	Thu Apr 18 02:19:19 2002 +0000
+++ b/Objects/complexobject.c	Thu Apr 18 02:19:46 2002 +0000
@@ -787,7 +787,7 @@
 
 		}  /* end of switch  */
 
-	} while (*s!='\0' && !sw_error);
+	} while (s - start < len && !sw_error);
 
 	if (sw_error) {
 		PyErr_SetString(PyExc_ValueError,