From: Tim Peters Date: Tue, 2 Oct 2001 21:32:07 +0000 (+0000) Subject: SF bug [#467265] Compile errors on SuSe Linux on IBM/s390. X-Git-Tag: v2.2.1c1~1493 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c15c4f1f39b2b3ca799c9a36b72a7c19a3c76e20;p=python 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(). --- diff --git a/Objects/stringobject.c b/Objects/stringobject.c index cfa5f53634..a43f129e95 100644 --- a/Objects/stringobject.c +++ b/Objects/stringobject.c @@ -150,12 +150,17 @@ PyString_FromString(const char *str) 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 == '%') { diff --git a/Python/errors.c b/Python/errors.c index c37d86bccc..2799cffc93 100644 --- a/Python/errors.c +++ b/Python/errors.c @@ -407,7 +407,7 @@ PyErr_Format(PyObject *exception, const char *format, ...) string = PyString_FromFormatV(format, vargs); PyErr_SetObject(exception, string); Py_XDECREF(string); - + va_end(vargs); return NULL; }