The gverrorf function was prototyped in a way that did not align with a function
pointer it was stored into. On platforms with more forgiving varargs calling
conventions, everything worked out OK. However, on other platforms calling
gverrorf through this function pointer would result in stack corruption. This
change aligns gverrorf with the type of the function pointer in which it is
stored.
}
static int
-gverrorf (Expr_t *handle, Exdisc_t *discipline, int level, ...)
+gverrorf (Expr_t *handle, Exdisc_t *discipline, int level, const char *fmt, ...)
{
va_list ap;
- const char *s;
- va_start(ap, level);
- s = va_arg(ap, char *);
+ va_start(ap, fmt);
errorv((discipline
- && handle) ? *((char **) handle) : (char *) handle, level, s, ap);
+ && handle) ? *((char **) handle) : (char *) handle, level, fmt, ap);
va_end(ap);
if (level >= ERROR_ERROR) {