]> granicus.if.org Git - python/commitdiff
SF bug [#467265] Compile errors on SuSe Linux on IBM/s390.
authorTim Peters <tim.peters@gmail.com>
Tue, 2 Oct 2001 21:32:07 +0000 (21:32 +0000)
committerTim Peters <tim.peters@gmail.com>
Tue, 2 Oct 2001 21:32:07 +0000 (21:32 +0000)
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().

Objects/stringobject.c
Python/errors.c

index cfa5f536345886d37e0e681bf57df0415520fda2..a43f129e9543761908b388d345c09ef7299699da 100644 (file)
@@ -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 == '%') {
index c37d86bccc39738b754c84a06e06d08fdff1a904..2799cffc93ba2fa42692f86cb6321a9409f05ef4 100644 (file)
@@ -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;
 }