summaryrefslogtreecommitdiff
path: root/plugins/Weather/src/weather_http.cpp
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2016-03-24 23:32:20 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2016-03-24 23:32:20 +0000
commit79412831126e49d990a44506af1ae69f78797d6c (patch)
tree9b08aab70ee1be9fc36adb51cf4d3f4337991383 /plugins/Weather/src/weather_http.cpp
parent2e7f9dcf085ba41ab37bd3234c5fd27781896114 (diff)
Weather: - minor fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@16539 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Weather/src/weather_http.cpp')
-rw-r--r--plugins/Weather/src/weather_http.cpp20
1 files changed, 12 insertions, 8 deletions
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, "<meta");
if (beg == NULL) break;
else {
- char* method, tmp;
end = strchr(beg, '>');
- 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;
}
}
}