--- libgig/trunk/src/tools/korg2gig.cpp 2016/05/12 19:34:17 2909 +++ libgig/trunk/src/tools/korg2gig.cpp 2017/05/11 11:34:19 3175 @@ -1,6 +1,6 @@ /*************************************************************************** * * - * Copyright (C) 2014-2015 Christian Schoenebeck * + * Copyright (C) 2014-2017 Christian Schoenebeck * * * * * * This program is part of libgig. * @@ -68,6 +68,7 @@ } static bool endsWith(const string& haystack, const string& needle) { + if (haystack.size() < needle.size()) return false; return haystack.substr(haystack.size() - needle.size(), needle.size()) == needle; } @@ -214,7 +215,7 @@ stripWhiteSpace(w); stripLeftOrRightMarkerAtEnd(w); string result = parseNumberRangeAtEnd(w, from, to); - if (result == w) return s; // parse error occured, return original input s + if (result == w) return s; // parse error occurred, return original input s stripWhiteSpace(result); return result; } @@ -508,7 +509,7 @@ exit(EXIT_FAILURE); } catch (...) { cerr << "Failed opening input file '" << filename << "':" << endl; - cerr << "Unknown exception occured while trying to access input file." << endl; + cerr << "Unknown exception occurred while trying to access input file." << endl; exit(EXIT_FAILURE); } }