Skip to content

Commit

Permalink
Merge pull request #1924 from Exiv2/mergify/bp/0.27-maintenance/pr-1910
Browse files Browse the repository at this point in the history
Fix quadratic loops in pentaxmn_int.cpp (backport #1910)
  • Loading branch information
clanmills authored Sep 29, 2021
2 parents 676d959 + 7b579bd commit a6fa92d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pentaxmn_int.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1014,8 +1014,8 @@ namespace Exiv2 {
std::ostream& PentaxMakerNote::printVersion(std::ostream& os, const Value& value, const ExifData*)
{
std::string val = value.toString();
size_t i;
while ((i = val.find(' ')) != std::string::npos && i != val.length() - 1) {
size_t i = 0;
while ((i = val.find(' ', i)) != std::string::npos && i != val.length() - 1) {
val.replace(i, 1, ".");
}
os << val;
Expand All @@ -1025,8 +1025,8 @@ namespace Exiv2 {
std::ostream& PentaxMakerNote::printResolution(std::ostream& os, const Value& value, const ExifData*)
{
std::string val = value.toString();
size_t i;
while ((i = val.find(' ')) != std::string::npos && i != val.length() - 1) {
size_t i = 0;
while ((i = val.find(' ', i)) != std::string::npos && i != val.length() - 1) {
val.replace(i, 1, "x");
}
os << val;
Expand Down

0 comments on commit a6fa92d

Please sign in to comment.