File: debug.c

package info (click to toggle)
msitools 0.106%2Brepack-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 3,336 kB
  • sloc: ansic: 18,006; yacc: 862; sh: 416; perl: 217; makefile: 22
file content (25 lines) | stat: -rw-r--r-- 447 bytes parent folder | download | duplicates (6)
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];
}