diff Objects/complexobject.c @ 23031:5bda546ebe24 legacy-trunk

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. Bugfix candidate.
author Tim Peters <tim.peters@gmail.com>
date Sun, 14 Apr 2002 22:04:03 +0000
parents 72778ec94dec
children 454351ef50f1
line wrap: on
line diff
--- a/Objects/complexobject.c	Sun Apr 14 20:17:18 2002 +0000
+++ b/Objects/complexobject.c	Sun Apr 14 22:04:03 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,