mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-05-30 00:10:40 +00:00
va.[ch]:
new va function: nva which returns a strduped buffer expr.c options.c: use nva instead of strdup (va (... struct.c type.c: make type encoding work properly for structs
This commit is contained in:
parent
b98e52fb53
commit
e774943f24
7 changed files with 57 additions and 34 deletions
|
@ -30,17 +30,18 @@ static const char rcsid[] =
|
|||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
#ifdef HAVE_STRING_H
|
||||
# include <string.h>
|
||||
#endif
|
||||
#ifdef HAVE_STRINGS_H
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "QF/dstring.h"
|
||||
#include "QF/qtypes.h"
|
||||
#include "QF/sys.h"
|
||||
#include "QF/va.h"
|
||||
|
||||
#include "compat.h"
|
||||
|
||||
|
||||
/*
|
||||
va
|
||||
|
@ -63,3 +64,19 @@ va (const char *fmt, ...)
|
|||
|
||||
return string->str;
|
||||
}
|
||||
|
||||
char *
|
||||
nva (const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
static dstring_t *string;
|
||||
|
||||
if (!string)
|
||||
string = dstring_new ();
|
||||
|
||||
va_start (args, fmt);
|
||||
dvsprintf (string, fmt, args);
|
||||
va_end (args);
|
||||
|
||||
return strdup (string->str);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue