--- cfg_fmt.c 2004/12/31 19:16:25 1.7
+++ cfg_fmt.c 2005/01/24 14:18:48 1.8
@@ -97,6 +97,7 @@
#include <string.h>
#include <ctype.h>
+#include "config.h"
#include "cfg_fmt.h"
/* types which are locally use */
@@ -1040,7 +1041,7 @@
if (vbuff->format != NULL) {
vbuff->format(vbuff,
&prefix_char, &pad_char, &s, &s_len,
- num_buf, NUM_BUF_SIZE, extinfo, *fmt, &ap);
+ num_buf, NUM_BUF_SIZE, extinfo, *fmt, ap);
if (s == NULL)
return -1;
}
@@ -1150,12 +1151,12 @@
char *s;
int rv;
- apbak = ap;
+ va_copy(apbak, ap);
if ((rv = cfg_fmt_vsprintf(NULL, -1, fmt, ap)) == -1)
return NULL;
if ((s = malloc(rv+1)) == NULL)
return NULL;
- ap = apbak;
+ va_copy(ap, apbak);
if ((rv = cfg_fmt_vsprintf(s, rv+1, fmt, ap)) == -1)
return NULL;
return s;
|