From 895101a6a4e41f612c28665664d3f7ce2d1f4a97 Mon Sep 17 00:00:00 2001 From: "fix94.1" Date: Tue, 31 Jan 2012 19:27:34 +0000 Subject: [PATCH] -fixed cover download crash if no {loc} is in url_full_covers --- source/menu/menu_download.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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;