[libpng16] use PNG_LIBPNG_VER_STRING[i] in png_user_version_check()

This commit is contained in:
Glenn Randers-Pehrson 2014-11-05 15:02:45 -06:00
parent a2fe24d186
commit 5be76ae252

7
png.c
View File

@ -178,11 +178,12 @@ png_user_version_check(png_structrp png_ptr, png_const_charp user_png_ver)
do
{
i++;
if (user_png_ver[i] != png_libpng_ver[i])
if (user_png_ver[i] != PNG_LIBPNG_VER_STRING[i])
png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH;
if (user_png_ver[i] == '.')
found_dots++;
} while (found_dots < 2 && png_libpng_ver[i] != 0 && user_png_ver[i] != 0);
} while (found_dots < 2 && user_png_ver[i] != 0 &&
PNG_LIBPNG_VER_STRING[i] != 0);
}
else
@ -198,7 +199,7 @@ png_user_version_check(png_structrp png_ptr, png_const_charp user_png_ver)
"Application built with libpng-");
pos = png_safecat(m, (sizeof m), pos, user_png_ver);
pos = png_safecat(m, (sizeof m), pos, " but running with ");
pos = png_safecat(m, (sizeof m), pos, png_libpng_ver);
pos = png_safecat(m, (sizeof m), pos, PNG_LIBPNG_VER_STRING);
PNG_UNUSED(pos)
png_warning(png_ptr, m);