diff Objects/stringobject.c @ 20221:abaf9ea2e560 legacy-trunk

SF bug [#467265] Compile errors on SuSe Linux on IBM/s390. Unknown whether this fixes it. - stringobject.c, PyString_FromFormatV: don't assume that va_list is of a type that can be copied via an initializer. - errors.c, PyErr_Format: add a va_end() to balance the va_start().
author Tim Peters <tim.peters@gmail.com>
date Tue, 02 Oct 2001 21:32:07 +0000
parents 225f17ec8932
children 2983b54256c7
line wrap: on
line diff
--- a/Objects/stringobject.c	Tue Oct 02 21:24:57 2001 +0000
+++ b/Objects/stringobject.c	Tue Oct 02 21:32:07 2001 +0000
@@ -150,12 +150,17 @@
 PyObject *
 PyString_FromFormatV(const char *format, va_list vargs)
 {
-	va_list count = vargs;
+	va_list count;
 	int n = 0;
 	const char* f;
 	char *s;
 	PyObject* string;
 
+#ifdef VA_LIST_IS_ARRAY
+	memcpy(count, vargs, sizeof(va_list));
+#else
+	count = vargs;
+#endif
 	/* step 1: figure out how large a buffer we need */
 	for (f = format; *f; f++) {
 		if (*f == '%') {