blob: e59bd2f61e3a67e7d9027025d324f37327209610 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#include <glib.h>
#include "debug.h"
G_GNUC_INTERNAL
const char *wine_dbg_sprintf( const char *format, ...)
{
static char *p_ret[10];
static int i;
char *ret;
unsigned len;
va_list ap;
va_start(ap, format);
ret = g_strdup_vprintf(format, ap);
len = strlen(ret);
va_end(ap);
i = (i + 1) % 10;
p_ret[i] = realloc(p_ret[i], len + 1);
strcpy(p_ret[i], ret);
g_free(ret);
return p_ret[i];
}
|