From 53bf442bebb54e57332a91aae749a70c18c48f08 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Fri, 13 Dec 2019 08:30:40 +0100 Subject: [PATCH] Update ColladaParser.cpp Fix review findings. --- code/Collada/ColladaParser.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/code/Collada/ColladaParser.cpp b/code/Collada/ColladaParser.cpp index 1b5b3b4d6..1577c794a 100644 --- a/code/Collada/ColladaParser.cpp +++ b/code/Collada/ColladaParser.cpp @@ -438,13 +438,19 @@ void ColladaParser::ReadContributorInfo() } } -bool FindCommonKey(const char *collada_key, const MetaKeyPairVector &key_renaming, size_t &found_index) { +static bool FindCommonKey(const char *collada_key, const MetaKeyPairVector &key_renaming, size_t &found_index) { + found_index = 9999999u; + if ( nullptr == collada_key ) { + return false; + } + for (size_t i = 0; i < key_renaming.size(); ++i) { - if (strcmp(key_renaming[i].first, collada_key) == 0) { + if (strncmp(key_renaming[i].first, collada_key, strlen(collada_key)) == 0) { found_index = i; return true; } } + return false; }