diff --git a/pngwutil.c b/pngwutil.c index 062993a63..8340d382e 100644 --- a/pngwutil.c +++ b/pngwutil.c @@ -92,8 +92,10 @@ png_write_chunk_header(png_structp png_ptr, png_uint_32 chunk_name, { png_byte buf[8]; - png_debug2(0, "Writing %s chunk, length = %lu", chunk_name, - (unsigned long)length); +#ifdef PNG_DEBUG + PNG_CSTRING_FROM_CHUNK(buf, chunk_name); + png_debug2(0, "Writing %s chunk, length = %lu", buf, (unsigned long)length); +#endif if (png_ptr == NULL) return;