gdErrorMethod declaration was wrong, we need to pass rest of the arguments in va_list
parent
bfbbf3c9f2
commit
e5dcee5ddf
9
src/gd.c
9
src/gd.c
|
@ -69,11 +69,8 @@ static const unsigned char gd_toascii[256] = {
|
|||
extern const int gdCosT[];
|
||||
extern const int gdSinT[];
|
||||
|
||||
void gd_stderr_error(int priority, const char *format, ...)
|
||||
void gd_stderr_error(int priority, const char *format, va_list args)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
va_start(args, format);
|
||||
switch (priority) {
|
||||
case GD_ERROR:
|
||||
fputs("GD Error: ", stderr);
|
||||
|
@ -91,9 +88,7 @@ void gd_stderr_error(int priority, const char *format, ...)
|
|||
fputs("GD Debug: ", stderr);
|
||||
break;
|
||||
}
|
||||
va_start(args, format);
|
||||
fprintf(stderr, format, args);
|
||||
va_end(args);
|
||||
vfprintf(stderr, format, args);
|
||||
fflush(stderr);
|
||||
}
|
||||
|
||||
|
|
2
src/gd.h
2
src/gd.h
|
@ -346,7 +346,7 @@ gdFont;
|
|||
/* Text functions take these. */
|
||||
typedef gdFont *gdFontPtr;
|
||||
|
||||
typedef void(*gdErrorMethod)(int, const char *, ...);
|
||||
typedef void(*gdErrorMethod)(int, const char *, va_list);
|
||||
|
||||
BGD_DECLARE(void) gdSetErrorMethod(gdErrorMethod);
|
||||
BGD_DECLARE(void) gdClearErrorMethod(void);
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include "gdtest.h"
|
||||
#include "test_config.h"
|
||||
|
||||
void gdSilence(int priority, const char *format, ...)
|
||||
void gdSilence(int priority, const char *format, va_list args)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -39,6 +39,6 @@ int _gdTestErrorMsg(const char* file, unsigned int line, const char* string, ...
|
|||
|
||||
#define gdTestErrorMsg(format, ...) _gdTestErrorMsg(__FILE__, __LINE__, format, ## __VA_ARGS__)
|
||||
|
||||
void gdSilence(int priority, const char *format, ...);
|
||||
void gdSilence(int priority, const char *format, va_list args);
|
||||
|
||||
#endif /* GD_TEST_H */
|
||||
|
|
Loading…
Reference in New Issue