diff --git a/src/futils.cpp b/src/futils.cpp index 9b8e3792..e24acbca 100644 --- a/src/futils.cpp +++ b/src/futils.cpp @@ -215,7 +215,7 @@ namespace Exiv2 { if (j < output_length) out[j++] = (triple >> 1 * 8) & 0xFF; if (j < output_length) out[j++] = (triple >> 0 * 8) & 0xFF; } - out[output_length++]=0; + out[output_length]=0; result = output_length; } diff --git a/unitTests/test_futils.cpp b/unitTests/test_futils.cpp index 25545fd1..46b21dd1 100644 --- a/unitTests/test_futils.cpp +++ b/unitTests/test_futils.cpp @@ -147,7 +147,7 @@ TEST(base64decode, decodesValidString) const std::string original ("VGhpcyBpcyBhIHVuaXQgdGVzdA=="); const std::string expected ("This is a unit test"); char * result = new char [original.size()]; - ASSERT_EQ(static_cast(expected.size()+1), + ASSERT_EQ(static_cast(expected.size()), base64decode(original.c_str(), result, original.size())); ASSERT_STREQ(expected.c_str(), result); delete [] result;