diff options
author | Tobias Weimer <wishmaster51@googlemail.com> | 2015-03-30 19:21:44 +0000 |
---|---|---|
committer | Tobias Weimer <wishmaster51@googlemail.com> | 2015-03-30 19:21:44 +0000 |
commit | 02ac3e7c9a90243ab30c7ea0f780e498262123e1 (patch) | |
tree | 2e28e113ed3287eef2e66551b3e8afd9dff2182f /plugins/Weather/src/weather_contacts.cpp | |
parent | 717a61c4ad2d5059b6403c492d666b2b09e1fd6c (diff) |
Weather:
- Minor fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@12555 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Weather/src/weather_contacts.cpp')
-rw-r--r-- | plugins/Weather/src/weather_contacts.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/plugins/Weather/src/weather_contacts.cpp b/plugins/Weather/src/weather_contacts.cpp index 31ed3ef939..58fb62a540 100644 --- a/plugins/Weather/src/weather_contacts.cpp +++ b/plugins/Weather/src/weather_contacts.cpp @@ -63,8 +63,7 @@ INT_PTR LoadForecast(WPARAM wParam, LPARAM lParam) if (id[0] != 0) {
// check if the complte forecast URL is set. If it is not, display warning and quit
if (DBGetStaticString(wParam, WEATHERPROTONAME, "InfoURL", loc2, SIZEOF(loc2)) || loc2[0] == 0) {
- MessageBox(NULL, TranslateT("The URL for complete forecast have not been set. You can set it from the Edit Settings dialog."),
- TranslateT("Weather Protocol"), MB_ICONINFORMATION);
+ MessageBox(NULL, NO_FORECAST_URL, TranslateT("Weather Protocol"), MB_ICONINFORMATION);
return 1;
}
// set the url and open the webpage
@@ -82,7 +81,7 @@ INT_PTR WeatherMap(WPARAM wParam, LPARAM lParam) if (id[0] != 0) {
// check if the weather map URL is set. If it is not, display warning and quit
if (DBGetStaticString(wParam, WEATHERPROTONAME, "MapURL", loc2, SIZEOF(loc2)) || loc2[0] == 0) {
- MessageBox(NULL, TranslateT("The URL for weather map have not been set. You can set it from the Edit Settings dialog."), TranslateT("Weather Protocol"), MB_ICONINFORMATION);
+ MessageBox(NULL, NO_MAP_URL, TranslateT("Weather Protocol"), MB_ICONINFORMATION);
return 1;
}
@@ -294,15 +293,15 @@ INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa ofn.lpstrFile = str;
ofn.nMaxFile = SIZEOF(str);
// set filters
- _tcsncpy(filter, TranslateT("Text Files"), SIZEOF(filter));
- _tcsncat(filter, _T(" (*.txt)"), SIZEOF(filter));
+ _tcsncpy(filter, TranslateT("Text Files"), SIZEOF(filter) - 1);
+ _tcsncat(filter, _T(" (*.txt)"), SIZEOF(filter) - 1);
pfilter = filter + _tcslen(filter)+1;
- _tcsncpy(pfilter, _T("*.txt"), SIZEOF(filter));
+ _tcsncpy(pfilter, _T("*.txt"), SIZEOF(filter) - 1);
pfilter = pfilter + _tcslen(pfilter)+1;
- _tcsncpy(pfilter, TranslateT("All Files"), SIZEOF(filter));
- _tcsncat(pfilter, _T(" (*.*)"), SIZEOF(filter));
+ _tcsncpy(pfilter, TranslateT("All Files"), SIZEOF(filter) - 1);
+ _tcsncat(pfilter, _T(" (*.*)"), SIZEOF(filter) - 1);
pfilter = pfilter + _tcslen(pfilter)+1;
- _tcsncpy(pfilter, _T("*.*"), SIZEOF(filter));
+ _tcsncpy(pfilter, _T("*.*"), SIZEOF(filter) - 1);
pfilter = pfilter + _tcslen(pfilter)+1;
*pfilter = '\0';
ofn.lpstrFilter = filter;
@@ -453,7 +452,7 @@ int ContactDeleted(WPARAM wParam, LPARAM lParam) // if the station is not a default station, set it as the new default station
// this is the first weather station encountered from the search
if ( _tcscmp(opt.Default, dbv.ptszVal)) {
- _tcscpy(opt.Default, dbv.ptszVal);
+ _tcsncpy(opt.Default, dbv.ptszVal, SIZEOF(opt.Default) - 1);
opt.DefStn = hContact;
db_free(&dbv);
if ( !db_get_ts(hContact, WEATHERPROTONAME, "Nick", &dbv)) {
|