From 79412831126e49d990a44506af1ae69f78797d6c Mon Sep 17 00:00:00 2001 From: Tobias Weimer Date: Thu, 24 Mar 2016 23:32:20 +0000 Subject: Weather: - minor fixes git-svn-id: http://svn.miranda-ng.org/main/trunk@16539 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Weather/src/weather_http.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'plugins/Weather/src/weather_http.cpp') diff --git a/plugins/Weather/src/weather_http.cpp b/plugins/Weather/src/weather_http.cpp index 89cac41c2f..7d63c1ad6c 100644 --- a/plugins/Weather/src/weather_http.cpp +++ b/plugins/Weather/src/weather_http.cpp @@ -103,16 +103,20 @@ int InternetDownloadFile(char *szUrl, char *cookie, char *userAgent, TCHAR **szD char* beg = strstr(end, "'); - tmp = *end; *end = 0; - - method = strstr(beg, "http-equiv=\""); - if (method && _strnicmp(method + 12, "Content-Type", 12) == 0 && strstr(method, "utf-8")) { - bIsUtf = true; - break; + if (end) + { + char tmp = *end; + *end = 0; + + char *method = strstr(beg, "http-equiv=\""); + if (method && _strnicmp(method + 12, "Content-Type", 12) == 0 && strstr(method, "utf-8")) { + bIsUtf = true; + *end = tmp; + break; + } + else *end = tmp; } - else *end = tmp; } } } -- cgit v1.2.3