diff --git a/source/menu/menu_download.cpp b/source/menu/menu_download.cpp index 3f7af381..fbf4bd4e 100644 --- a/source/menu/menu_download.cpp +++ b/source/menu/menu_download.cpp @@ -119,7 +119,8 @@ static string countryCode(const string &gameId) static string makeURL(const string format, const string gameId, const string country) { string url = format; - url.replace(url.find(TAG_LOC), strlen(TAG_LOC), country.c_str()); + if (url.find(TAG_LOC) == 0) //check if {loc} is in the URL before trying to replace it + url.replace(url.find(TAG_LOC), strlen(TAG_LOC), country.c_str()); url.replace(url.find(TAG_GAME_ID), strlen(TAG_GAME_ID), gameId.c_str()); return url;