diff options
Diffstat (limited to 'pngerror.c')
-rw-r--r-- | pngerror.c | 51 |
1 files changed, 35 insertions, 16 deletions
@@ -1,12 +1,15 @@ /* pngerror.c - stub functions for i/o and memory allocation * - * Last changed in libpng 1.2.34 [December 18, 2008] - * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2008 Glenn Randers-Pehrson + * Last changed in libpng 1.2.37 [June 4, 2009] + * Copyright (c) 1998-2009 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * + * This code is released under the libpng license. + * For conditions of distribution and use, see the disclaimer + * and license in png.h + * * This file provides a location for all error handling. Users who * need special error handling are expected to write replacement functions * and use png_set_error_fn() to use those functions. See the instructions @@ -44,7 +47,7 @@ png_error(png_structp png_ptr, png_const_charp error_message) { if (*error_message == '#') { - /* Strip "#nnnn " from beginning of error message. */ + /* Strip "#nnnn " from beginning of error message. */ int offset; for (offset = 1; offset<15; offset++) if (error_message[offset] == ' ') @@ -217,7 +220,7 @@ png_default_error(png_structp png_ptr, png_const_charp error_message) #ifdef PNG_ERROR_NUMBERS_SUPPORTED if (*error_message == '#') { - /* Strip "#nnnn " from beginning of warning message. */ + /* Strip "#nnnn " from beginning of error message. */ int offset; char error_number[16]; for (offset = 0; offset<15; offset++) @@ -229,15 +232,23 @@ png_default_error(png_structp png_ptr, png_const_charp error_message) if ((offset > 1) && (offset < 15)) { error_number[offset - 1] = '\0'; - fprintf(stderr, "libpng error no. %s: %s\n", error_number, - error_message + offset + 1); + fprintf(stderr, "libpng error no. %s: %s", + error_number, error_message + offset + 1); + fprintf(stderr, PNG_STRING_NEWLINE); } else - fprintf(stderr, "libpng error: %s, offset=%d\n", error_message, offset); + { + fprintf(stderr, "libpng error: %s, offset=%d", + error_message, offset); + fprintf(stderr, PNG_STRING_NEWLINE); + } } else #endif - fprintf(stderr, "libpng error: %s\n", error_message); + { + fprintf(stderr, "libpng error: %s", error_message); + fprintf(stderr, PNG_STRING_NEWLINE); + } #endif #ifdef PNG_SETJMP_SUPPORTED @@ -257,7 +268,7 @@ png_default_error(png_structp png_ptr, png_const_charp error_message) PNG_ABORT(); #endif #ifdef PNG_NO_CONSOLE_IO - error_message = error_message; /* make compiler happy */ + error_message = error_message; /* Make compiler happy */ #endif } @@ -285,19 +296,27 @@ png_default_warning(png_structp png_ptr, png_const_charp warning_message) if ((offset > 1) && (offset < 15)) { warning_number[offset + 1] = '\0'; - fprintf(stderr, "libpng warning no. %s: %s\n", warning_number, - warning_message + offset); + fprintf(stderr, "libpng warning no. %s: %s", + warning_number, warning_message + offset); + fprintf(stderr, PNG_STRING_NEWLINE); } else - fprintf(stderr, "libpng warning: %s\n", warning_message); + { + fprintf(stderr, "libpng warning: %s", + warning_message); + fprintf(stderr, PNG_STRING_NEWLINE); + } } else # endif - fprintf(stderr, "libpng warning: %s\n", warning_message); + { + fprintf(stderr, "libpng warning: %s", warning_message); + fprintf(stderr, PNG_STRING_NEWLINE); + } #else - warning_message = warning_message; /* make compiler happy */ + warning_message = warning_message; /* Make compiler happy */ #endif - png_ptr = png_ptr; /* make compiler happy */ + png_ptr = png_ptr; /* Make compiler happy */ } #endif /* PNG_NO_WARNINGS */ |