Terminate empty ASCII strings as well

This commit is contained in:
Miloš Komarčević 2021-03-10 21:44:12 +01:00
parent 9e2ac47cf9
commit 26ba26e241

View File

@ -410,7 +410,7 @@ namespace Exiv2 {
int AsciiValue::read(const std::string& buf)
{
value_ = buf;
if (value_.size() > 0 && value_[value_.size()-1] != '\0') value_ += '\0';
if (value_.size() == 0 || value_[value_.size()-1] != '\0') value_ += '\0';
return 0;
}