Commit 6e7fedcc authored by Tim Peters's avatar Tim Peters

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().
parent 08face02
...@@ -150,12 +150,17 @@ PyString_FromString(const char *str) ...@@ -150,12 +150,17 @@ PyString_FromString(const char *str)
PyObject * PyObject *
PyString_FromFormatV(const char *format, va_list vargs) PyString_FromFormatV(const char *format, va_list vargs)
{ {
va_list count = vargs; va_list count;
int n = 0; int n = 0;
const char* f; const char* f;
char *s; char *s;
PyObject* string; 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 */ /* step 1: figure out how large a buffer we need */
for (f = format; *f; f++) { for (f = format; *f; f++) {
if (*f == '%') { if (*f == '%') {
......
...@@ -407,7 +407,7 @@ PyErr_Format(PyObject *exception, const char *format, ...) ...@@ -407,7 +407,7 @@ PyErr_Format(PyObject *exception, const char *format, ...)
string = PyString_FromFormatV(format, vargs); string = PyString_FromFormatV(format, vargs);
PyErr_SetObject(exception, string); PyErr_SetObject(exception, string);
Py_XDECREF(string); Py_XDECREF(string);
va_end(vargs);
return NULL; return NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment