mirror of
https://github.com/fltk/fltk.git
synced 2026-05-27 02:46:34 +08:00
Fix libpng compilation warning (#757)
According to the reported issue this warning appears when using gcc 13.1.0 (rev7, MinGW-W64). it's very likely a new warning and a false positive because the buffer is used as an output parameter, but anyway.
This commit is contained in:
+2
-2
@@ -255,7 +255,7 @@ void
|
|||||||
png_warning_parameter_unsigned(png_warning_parameters p, int number, int format,
|
png_warning_parameter_unsigned(png_warning_parameters p, int number, int format,
|
||||||
png_alloc_size_t value)
|
png_alloc_size_t value)
|
||||||
{
|
{
|
||||||
char buffer[PNG_NUMBER_BUFFER_SIZE];
|
char buffer[PNG_NUMBER_BUFFER_SIZE] = {0}; /* FLTK Issue #757 */
|
||||||
png_warning_parameter(p, number, PNG_FORMAT_NUMBER(buffer, format, value));
|
png_warning_parameter(p, number, PNG_FORMAT_NUMBER(buffer, format, value));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -265,7 +265,7 @@ png_warning_parameter_signed(png_warning_parameters p, int number, int format,
|
|||||||
{
|
{
|
||||||
png_alloc_size_t u;
|
png_alloc_size_t u;
|
||||||
png_charp str;
|
png_charp str;
|
||||||
char buffer[PNG_NUMBER_BUFFER_SIZE];
|
char buffer[PNG_NUMBER_BUFFER_SIZE] = {0}; /* FLTK Issue #757 */
|
||||||
|
|
||||||
/* Avoid overflow by doing the negate in a png_alloc_size_t: */
|
/* Avoid overflow by doing the negate in a png_alloc_size_t: */
|
||||||
u = (png_alloc_size_t)value;
|
u = (png_alloc_size_t)value;
|
||||||
|
|||||||
Reference in New Issue
Block a user