mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
Imported from libpng-1.2.23beta02.tar
This commit is contained in:
11
pngerror.c
11
pngerror.c
@@ -1,7 +1,7 @@
|
||||
|
||||
/* pngerror.c - stub functions for i/o and memory allocation
|
||||
*
|
||||
* Last changed in libpng 1.2.22 [October 15, 2007]
|
||||
* Last changed in libpng 1.2.22 [October 16, 2007]
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2007 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
@@ -136,7 +136,7 @@ static PNG_CONST char png_digit[16] = {
|
||||
'A', 'B', 'C', 'D', 'E', 'F'
|
||||
};
|
||||
|
||||
#define PNG_MAX_ERROR_TEXT 63
|
||||
#define PNG_MAX_ERROR_TEXT 64
|
||||
|
||||
#if !defined(PNG_NO_WARNINGS) || !defined(PNG_NO_ERROR_TEXT)
|
||||
static void /* PRIVATE */
|
||||
@@ -167,8 +167,7 @@ png_format_buffer(png_structp png_ptr, png_charp buffer, png_const_charp
|
||||
{
|
||||
buffer[iout++] = ':';
|
||||
buffer[iout++] = ' ';
|
||||
png_strncpy(buffer+iout, error_message, PNG_MAX_ERROR_TEXT);
|
||||
buffer[iout+PNG_MAX_ERROR_TEXT] = '\0';
|
||||
png_memcpy(buffer+iout, error_message, PNG_MAX_ERROR_TEXT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -176,7 +175,7 @@ png_format_buffer(png_structp png_ptr, png_charp buffer, png_const_charp
|
||||
void PNGAPI
|
||||
png_chunk_error(png_structp png_ptr, png_const_charp error_message)
|
||||
{
|
||||
char msg[18+64];
|
||||
char msg[18+PNG_MAX_ERROR_TEXT];
|
||||
if (png_ptr == NULL)
|
||||
png_error(png_ptr, error_message);
|
||||
else
|
||||
@@ -192,7 +191,7 @@ png_chunk_error(png_structp png_ptr, png_const_charp error_message)
|
||||
void PNGAPI
|
||||
png_chunk_warning(png_structp png_ptr, png_const_charp warning_message)
|
||||
{
|
||||
char msg[18+64];
|
||||
char msg[18+PNG_MAX_ERROR_TEXT];
|
||||
if (png_ptr == NULL)
|
||||
png_warning(png_ptr, warning_message);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user