diff options
Diffstat (limited to 'Build/source/libs/gd/libgd-src/tests/png/bug00338.c')
-rw-r--r-- | Build/source/libs/gd/libgd-src/tests/png/bug00338.c | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/Build/source/libs/gd/libgd-src/tests/png/bug00338.c b/Build/source/libs/gd/libgd-src/tests/png/bug00338.c index 0bdd9f9a6f0..f439d8cb8ce 100644 --- a/Build/source/libs/gd/libgd-src/tests/png/bug00338.c +++ b/Build/source/libs/gd/libgd-src/tests/png/bug00338.c @@ -8,41 +8,37 @@ * See also ../jpeg/bug00338.c */ - #include <string.h> #include "gd.h" #include "gd_errors.h" #include "gdtest.h" - #define MSG "gd-png: fatal libpng error: %s\n" - static int error_handler_called = 0; - static void error_handler(int priority, const char *format, va_list args) { - if (!strcmp(format, MSG)) { - gdTestAssertMsg(priority == GD_WARNING, "expected priority %d, but got %d", GD_WARNING, priority); - error_handler_called = 1; - } + if (!strcmp(format, MSG)) { + gdTestAssertMsg(priority == GD_WARNING, "expected priority %d, but got %d", GD_WARNING, priority); + error_handler_called = 1; + } } - int main() { - gdImagePtr im; - FILE *fp; + gdImagePtr im; + FILE *fp; - gdSetErrorMethod(error_handler); + gdSetErrorMethod(error_handler); - im = gdImageCreateTrueColor(10, 10); - fp = gdTestTempFp(); - gdImagePngEx(im, fp, 100); - gdImageDestroy(im); + im = gdImageCreateTrueColor(10, 10); + fp = gdTestTempFp(); + gdImagePngEx(im, fp, 100); + gdImageDestroy(im); + fclose(fp); - gdTestAssert(error_handler_called); + gdTestAssert(error_handler_called); - return gdNumFailures(); + return gdNumFailures(); } |