diff --git a/src/pngchunk_int.cpp b/src/pngchunk_int.cpp index 4068da86..b1db4999 100644 --- a/src/pngchunk_int.cpp +++ b/src/pngchunk_int.cpp @@ -22,6 +22,8 @@ #include "config.h" #ifdef EXV_HAVE_LIBZ +#include // To uncompress or compress text chunk + #include "enforce.hpp" #include "error.hpp" #include "exif.hpp" @@ -33,8 +35,6 @@ #include "safe_op.hpp" #include "tiffimage.hpp" -#include // To uncompress or compress text chunk - // standard includes #include #include @@ -108,7 +108,7 @@ namespace Exiv2 // Search for null char until the end of the DataBuf const byte* dataPtr = data.c_data(); int keysize = offset; - while (dataPtr[keysize] != 0 && keysize < data.size()) { + while (keysize < data.size() && dataPtr[keysize] != 0) { keysize++; }