[libpng10] Imported from libpng-1.0.38rc06.tar

This commit is contained in:
Glenn Randers-Pehrson
2008-07-29 13:22:57 -05:00
parent cf77d0d594
commit ac9a0378fd
62 changed files with 152 additions and 166 deletions

View File

@@ -1,7 +1,7 @@
/* pngerror.c - stub functions for i/o and memory allocation
*
* Last changed in libpng 1.2.30 [July 25, 2008]
* Last changed in libpng 1.2.30 [July 29, 2008]
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@@ -44,13 +44,7 @@ png_error(png_structp png_ptr, png_const_charp error_message)
{
if (*error_message == '#')
{
/*
* 012345678901234567890
* error_message: #nnnn text\0
* error_number: nnnn\0
* offset points to the first blank after nnnn
* In this example, offset is 5.
*/
/* Strip "#nnnn " from beginning of error message. */
int offset;
for (offset = 1; offset<15; offset++)
if (error_message[offset] == ' ')
@@ -60,7 +54,7 @@ png_error(png_structp png_ptr, png_const_charp error_message)
int i;
for (i = 0; i < offset - 1; i++)
msg[i] = error_message[i + 1];
msg[i] = '\0';
msg[i - 1] = '\0';
error_message = msg;
}
else
@@ -223,14 +217,7 @@ png_default_error(png_structp png_ptr, png_const_charp error_message)
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
if (*error_message == '#')
{
/*
* 012345678901234567890
* error_message: #nnnn text\0
* error_number: nnnn\0
* offset points to the first blank after nnnn
* In this example, offset is 5, and we want to
* insert a terminating NULL at error_number[4].
*/
/* Strip "#nnnn " from beginning of warning message. */
int offset;
char error_number[16];
for (offset = 0; offset<15; offset++)
@@ -241,10 +228,9 @@ png_default_error(png_structp png_ptr, png_const_charp error_message)
}
if ((offset > 1) && (offset < 15))
{
error_number[offset - 1] = '\0'; /* should this be [offset + 1]? */
/* should we update "offset" to point to the beginning of the text? */
error_number[offset - 1] = '\0';
fprintf(stderr, "libpng error no. %s: %s\n", error_number,
error_message + offset);
error_message + offset + 1);
}
else
fprintf(stderr, "libpng error: %s, offset=%d\n", error_message, offset);