1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-08 17:33:13 +02:00

More FORMAT_STRING() checking, get rid of old (non-)USE_VARARGS stuff.

Fix some more bugs (type differences) when compiling in DEBUGMODE.
This commit is contained in:
Bram Matthys
2019-08-24 19:37:25 +02:00
parent a3b5f29626
commit 9e02ca2b3c
11 changed files with 75 additions and 114 deletions
+1 -13
View File
@@ -119,15 +119,7 @@ void flag_del(char ch)
static char debugbuf[4096];
#ifndef USE_VARARGS
/*VARARGS2*/
void debug(level, form, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10)
int level;
char *form, *p1, *p2, *p3, *p4, *p5, *p6, *p7, *p8, *p9, *p10;
{
#else
void debug(int level, char *form, ...)
#endif
void debug(int level, FORMAT_STRING(const char *form), ...)
{
int err = ERRNO;
@@ -136,11 +128,7 @@ void debug(int level, char *form, ...)
if ((debuglevel >= 0) && (level <= debuglevel))
{
#ifndef USE_VARARGS
(void)ircsnprintf(debugbuf, sizeof(debugbuf), form, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);
#else
(void)ircvsnprintf(debugbuf, sizeof(debugbuf), form, vl);
#endif
#ifndef _WIN32
strlcat(debugbuf, "\n", sizeof(debugbuf));