From 96aca14305247f5c0463ec99cf57033ff93ce6fd Mon Sep 17 00:00:00 2001 From: Andreas Huggel Date: Sat, 21 Aug 2004 15:55:31 +0000 Subject: [PATCH] Undid tagInfoIdx return -1 to return idx of 0xffff tag again (so that it prints "unknownTag") --- src/tags.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/tags.cpp b/src/tags.cpp index f9f2eed4..b399c67d 100644 --- a/src/tags.cpp +++ b/src/tags.cpp @@ -20,13 +20,13 @@ */ /* File: tags.cpp - Version: $Name: $ $Revision: 1.31 $ + Version: $Name: $ $Revision: 1.32 $ Author(s): Andreas Huggel (ahu) History: 15-Jan-04, ahu: created */ // ***************************************************************************** #include "rcsid.hpp" -EXIV2_RCSID("@(#) $Name: $ $Revision: 1.31 $ $RCSfile: tags.cpp,v $"); +EXIV2_RCSID("@(#) $Name: $ $Revision: 1.32 $ $RCSfile: tags.cpp,v $"); // ***************************************************************************** // included header files @@ -270,8 +270,8 @@ namespace Exiv2 { const TagInfo* tagInfo = tagInfos_[ifdId]; if (tagInfo == 0) return -1; int idx; - for (idx = 0; tagInfo[idx].tag_ != tag; ++idx) { - if (tagInfo[idx].tag_ == 0xffff) return -1; + for (idx = 0; tagInfo[idx].tag_ != 0xffff; ++idx) { + if (tagInfo[idx].tag_ == tag) break; } return idx; } @@ -281,8 +281,8 @@ namespace Exiv2 { const TagInfo* tagInfo = tagInfos_[ifdId]; if (tagInfo == 0) return -1; int idx; - for (idx = 0; tagInfo[idx].name_ != tagName; ++idx) { - if (tagInfo[idx].tag_ == 0xffff) return -1; + for (idx = 0; tagInfo[idx].tag_ != 0xffff; ++idx) { + if (tagInfo[idx].name_ == tagName) break; } return idx; }