diff --git a/src/frontend-common/game_database.cpp b/src/frontend-common/game_database.cpp index 8d74fc85e..0a3ee8b12 100644 --- a/src/frontend-common/game_database.cpp +++ b/src/frontend-common/game_database.cpp @@ -118,8 +118,11 @@ static const rapidjson::Value* FindDatabaseEntry(const std::string_view& code, r continue; } - if (StringUtil::Strncasecmp(current_code.GetString(), code.data(), code.length()) == 0) + if (current_code.GetStringLength() == code.length() && + StringUtil::Strncasecmp(current_code.GetString(), code.data(), code.length()) == 0) + { return ¤t; + } } }