diff --git a/app/actions.cpp b/app/actions.cpp index 57945e33..d7c3d623 100644 --- a/app/actions.cpp +++ b/app/actions.cpp @@ -1290,9 +1290,9 @@ void Modify::delMetadatum(Exiv2::Image* pImage, const ModifyCmd& modifyCmd) { } } if (modifyCmd.metadataId_ == MetadataId::xmp) { - Exiv2::XmpData::iterator pos; const Exiv2::XmpKey xmpKey(modifyCmd.key_); - if ((pos = xmpData.findKey(xmpKey)) != xmpData.end()) { + auto pos = xmpData.findKey(xmpKey); + if (pos != xmpData.end()) { xmpData.eraseFamily(pos); } } diff --git a/src/iptc.cpp b/src/iptc.cpp index 10209cc4..fa843647 100644 --- a/src/iptc.cpp +++ b/src/iptc.cpp @@ -401,8 +401,8 @@ int IptcParser::decode(IptcData& iptcData, const byte* pData, size_t size) { pRead += 2; } if (sizeData <= static_cast(pEnd - pRead)) { - int rc = 0; - if ((rc = readData(iptcData, dataSet, record, pRead, sizeData)) != 0) { + int rc = readData(iptcData, dataSet, record, pRead, sizeData); + if (rc != 0) { #ifndef SUPPRESS_WARNINGS EXV_WARNING << "Failed to read IPTC dataset " << IptcKey(dataSet, record) << " (rc = " << rc << "); skipped.\n"; #endif