From 25ee7f2595a94b9b95270a9617cfa4a84d2daa0e Mon Sep 17 00:00:00 2001 From: kaetemi Date: Fri, 7 Feb 2014 23:01:36 +0100 Subject: [PATCH] Fix crash in translation_tools --- code/ryzom/tools/translation_tools/main.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/code/ryzom/tools/translation_tools/main.cpp b/code/ryzom/tools/translation_tools/main.cpp index 3ec5a8b4a..253eee75d 100644 --- a/code/ryzom/tools/translation_tools/main.cpp +++ b/code/ryzom/tools/translation_tools/main.cpp @@ -2022,10 +2022,13 @@ void assertUniq(const vector& reference) phraseIdentifier.insert(first->Identifier); vector::const_iterator first2( first->Clauses.begin() ); vector::const_iterator last2( first->Clauses.end() ); - if (clauseIdentifier.find(first2->Identifier) != clauseIdentifier.end() ) + for( ; first2 != last2; ++first2) { - nlwarning("Clause %s defined more than once.", first2->Identifier.c_str()); - exit(-1); + if (clauseIdentifier.find(first2->Identifier) != clauseIdentifier.end() ) + { + nlwarning("Clause %s defined more than once.", first2->Identifier.c_str()); + exit(-1); + } } } } @@ -2034,7 +2037,7 @@ void assertUniq(const vector& reference) void mergePhraseDiff2Impl(vector& reference, const vector& addition) -{ +{ assertUniq(reference); assertUniq(addition); @@ -2046,11 +2049,11 @@ void mergePhraseDiff2Impl(vector& reference, const vector& add vector::const_iterator first( reference.begin() ); vector::const_iterator last( reference.end() ); for( ; first != last ; ++first ) - { + { std::string identifier = first->Identifier; - phrases[identifier] = *first; + phrases[identifier] = *first; } - } + } { vector::const_iterator first( addition.begin() ); @@ -2079,7 +2082,7 @@ void mergePhraseDiff2Impl(vector& reference, const vector& add } } } - + { reference.clear(); reference.reserve(phrases.size());