X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6d003204e01463901b8969ac0a7d975134792846..b60f5ca56d21a18b0294ed8b2769cdec0142ef70:/src/png/pngerror.c?ds=sidebyside diff --git a/src/png/pngerror.c b/src/png/pngerror.c index d0da28333e..fda078ef58 100644 --- a/src/png/pngerror.c +++ b/src/png/pngerror.c @@ -1,7 +1,7 @@ /* pngerror.c - stub functions for i/o and memory allocation * - * libpng version 1.2.6 - August 15, 2004 + * libpng version 1.2.7 - September 12, 2004 * For conditions of distribution and use, see copyright notice in png.h * Copyright (c) 1998-2004 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) @@ -109,14 +109,6 @@ static PNG_CONST char png_digit[16] = { 'A', 'B', 'C', 'D', 'E', 'F' }; -static size_t wxstrnlen( const char *s, size_t maxlen ) -{ - size_t i ; - for ( i = 0 ; s[i] && i < maxlen ; ++i ) - ; - return i ; -} - static void /* PRIVATE */ png_format_buffer(png_structp png_ptr, png_charp buffer, png_const_charp error_message) @@ -143,12 +135,10 @@ png_format_buffer(png_structp png_ptr, png_charp buffer, png_const_charp buffer[iout] = 0; else { - int len = wxstrnlen(error_message, 64); - buffer[iout++] = ':'; buffer[iout++] = ' '; - png_strncpy(buffer+iout, error_message, len); - buffer[iout+len] = 0; + png_strncpy(buffer+iout, error_message, 63); + buffer[iout+63] = 0; } }