summaryrefslogtreecommitdiff
path: root/plugins/Weather/src
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2015-05-23 18:08:26 +0000
committerKirill Volinsky <mataes2007@gmail.com>2015-05-23 18:08:26 +0000
commit9cadeadaff74b37df1c2896e653a80b3ce4c86f6 (patch)
tree399715b05def27cc4e13ced2cbefad3a17b77c4e /plugins/Weather/src
parent6fcfba2c46a456677b5825a899469ba4e8905448 (diff)
replace _tcsncpy to mir_tstrncpy
git-svn-id: http://svn.miranda-ng.org/main/trunk@13786 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Weather/src')
-rw-r--r--plugins/Weather/src/weather_addstn.cpp10
-rw-r--r--plugins/Weather/src/weather_contacts.cpp10
-rw-r--r--plugins/Weather/src/weather_data.cpp36
-rw-r--r--plugins/Weather/src/weather_info.cpp2
-rw-r--r--plugins/Weather/src/weather_ini.cpp2
-rw-r--r--plugins/Weather/src/weather_opt.cpp22
-rw-r--r--plugins/Weather/src/weather_popup.cpp8
-rw-r--r--plugins/Weather/src/weather_update.cpp6
-rw-r--r--plugins/Weather/src/weather_userinfo.cpp2
9 files changed, 49 insertions, 49 deletions
diff --git a/plugins/Weather/src/weather_addstn.cpp b/plugins/Weather/src/weather_addstn.cpp
index 5f2fd10f6b..ab22d58b7a 100644
--- a/plugins/Weather/src/weather_addstn.cpp
+++ b/plugins/Weather/src/weather_addstn.cpp
@@ -71,7 +71,7 @@ INT_PTR WeatherAddToList(WPARAM wParam, LPARAM lParam)
// set contact info and settings
TCHAR svc[256];
- _tcsncpy(svc, psr->email, SIZEOF(svc)); svc[SIZEOF(svc)-1] = 0;
+ mir_tstrncpy(svc, psr->email, SIZEOF(svc)); svc[SIZEOF(svc)-1] = 0;
GetSvc(svc);
// set settings by obtaining the default for the service
if (psr->lastName[0] != 0) {
@@ -156,7 +156,7 @@ static void __cdecl BasicSearchTimerProc(LPVOID hWnd)
INT_PTR WeatherBasicSearch(WPARAM wParam, LPARAM lParam)
{
if (searchId != -1) return 0; //only one search at a time
- _tcsncpy(sID, ( TCHAR* )lParam, SIZEOF(sID));
+ mir_tstrncpy(sID, ( TCHAR* )lParam, SIZEOF(sID));
sID[SIZEOF(sID)-1] = 0;
searchId = 1;
// create a thread for the ID search
@@ -250,7 +250,7 @@ int IDSearchProc(TCHAR *sID, const int searchId, WIIDSEARCH *sData, TCHAR *svc,
}
// give no station name but only ID if the search is unavailable
- else _tcsncpy(str, TranslateT("<Enter station name here>"), MAX_DATA_LEN - 1);
+ else mir_tstrncpy(str, TranslateT("<Enter station name here>"), MAX_DATA_LEN - 1);
mir_sntprintf(newID, SIZEOF(newID), _T("%s/%s"), svc, sID);
// set the search result and broadcast it
@@ -344,7 +344,7 @@ int NameSearchProc(TCHAR *name, const int searchId, WINAMESEARCH *sData, TCHAR *
// if can't get the name, use the search string as name
if (Name[0] == 0)
- _tcsncpy(Name, name, SIZEOF(Name));
+ mir_tstrncpy(Name, name, SIZEOF(Name));
// set the data and broadcast it
PROTOSEARCHRESULT psr = { sizeof(psr) };
@@ -383,7 +383,7 @@ int NameSearchProc(TCHAR *name, const int searchId, WINAMESEARCH *sData, TCHAR *
// if can't get the name, use the search string as name
if (Name[0] == 0)
- _tcsncpy(Name, name, SIZEOF(Name));
+ mir_tstrncpy(Name, name, SIZEOF(Name));
PROTOSEARCHRESULT psr = { sizeof(psr) };
psr.flags = PSR_TCHAR;
diff --git a/plugins/Weather/src/weather_contacts.cpp b/plugins/Weather/src/weather_contacts.cpp
index 5eec260dd7..947378c026 100644
--- a/plugins/Weather/src/weather_contacts.cpp
+++ b/plugins/Weather/src/weather_contacts.cpp
@@ -293,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) - 1);
+ mir_tstrncpy(filter, TranslateT("Text Files"), SIZEOF(filter) - 1);
mir_tstrncat(filter, _T(" (*.txt)"), SIZEOF(filter) - mir_tstrlen(filter));
pfilter = filter + mir_tstrlen(filter)+1;
- _tcsncpy(pfilter, _T("*.txt"), SIZEOF(filter) - 1);
+ mir_tstrncpy(pfilter, _T("*.txt"), SIZEOF(filter) - 1);
pfilter = pfilter + mir_tstrlen(pfilter)+1;
- _tcsncpy(pfilter, TranslateT("All Files"), SIZEOF(filter) - 1);
+ mir_tstrncpy(pfilter, TranslateT("All Files"), SIZEOF(filter) - 1);
mir_tstrncat(pfilter, _T(" (*.*)"), SIZEOF(filter) - mir_tstrlen(filter));
pfilter = pfilter + mir_tstrlen(pfilter)+1;
- _tcsncpy(pfilter, _T("*.*"), SIZEOF(filter) - 1);
+ mir_tstrncpy(pfilter, _T("*.*"), SIZEOF(filter) - 1);
pfilter = pfilter + mir_tstrlen(pfilter)+1;
*pfilter = '\0';
ofn.lpstrFilter = filter;
@@ -452,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 ( mir_tstrcmp(opt.Default, dbv.ptszVal)) {
- _tcsncpy(opt.Default, dbv.ptszVal, SIZEOF(opt.Default) - 1);
+ mir_tstrncpy(opt.Default, dbv.ptszVal, SIZEOF(opt.Default) - 1);
opt.DefStn = hContact;
db_free(&dbv);
if ( !db_get_ts(hContact, WEATHERPROTONAME, "Nick", &dbv)) {
diff --git a/plugins/Weather/src/weather_data.cpp b/plugins/Weather/src/weather_data.cpp
index f47db595de..9e5d3be614 100644
--- a/plugins/Weather/src/weather_data.cpp
+++ b/plugins/Weather/src/weather_data.cpp
@@ -50,35 +50,35 @@ WEATHERINFO LoadWeatherInfo(MCONTACT hContact)
GetStationID(hContact, winfo.id, SIZEOF(winfo.id));
if (DBGetStaticString(hContact, WEATHERPROTONAME, "Nick", winfo.city, SIZEOF(winfo.city)))
- _tcsncpy(winfo.city, NODATA, SIZEOF(winfo.city) - 1);
+ mir_tstrncpy(winfo.city, NODATA, SIZEOF(winfo.city) - 1);
if (DBGetStaticString(hContact, WEATHERCONDITION, "Update", winfo.update, SIZEOF(winfo.update)))
- _tcsncpy(winfo.update, NODATA, SIZEOF(winfo.update) - 1);
+ mir_tstrncpy(winfo.update, NODATA, SIZEOF(winfo.update) - 1);
if (DBGetStaticString(hContact, WEATHERCONDITION, "Condition", winfo.cond, SIZEOF(winfo.cond)))
- _tcsncpy(winfo.cond, NODATA, SIZEOF(winfo.cond) - 1);
+ mir_tstrncpy(winfo.cond, NODATA, SIZEOF(winfo.cond) - 1);
if (DBGetStaticString(hContact, WEATHERCONDITION, "Temperature", winfo.temp, SIZEOF(winfo.temp)))
- _tcsncpy(winfo.temp, NODATA, SIZEOF(winfo.temp) - 1);
+ mir_tstrncpy(winfo.temp, NODATA, SIZEOF(winfo.temp) - 1);
if (DBGetStaticString(hContact, WEATHERCONDITION, "High", winfo.high, SIZEOF(winfo.high)))
- _tcsncpy(winfo.high, NODATA, SIZEOF(winfo.high) - 1);
+ mir_tstrncpy(winfo.high, NODATA, SIZEOF(winfo.high) - 1);
if (DBGetStaticString(hContact, WEATHERCONDITION, "Low", winfo.low, SIZEOF(winfo.low)))
- _tcsncpy(winfo.low, NODATA, SIZEOF(winfo.low) - 1);
+ mir_tstrncpy(winfo.low, NODATA, SIZEOF(winfo.low) - 1);
if (DBGetStaticString(hContact, WEATHERCONDITION, "Sunset", winfo.sunset, SIZEOF(winfo.sunset)))
- _tcsncpy(winfo.sunset, NODATA, SIZEOF(winfo.sunset) - 1);
+ mir_tstrncpy(winfo.sunset, NODATA, SIZEOF(winfo.sunset) - 1);
if (DBGetStaticString(hContact, WEATHERCONDITION, "Sunrise", winfo.sunrise, SIZEOF(winfo.sunrise)))
- _tcsncpy(winfo.sunrise, NODATA, SIZEOF(winfo.sunrise) - 1);
+ mir_tstrncpy(winfo.sunrise, NODATA, SIZEOF(winfo.sunrise) - 1);
if (DBGetStaticString(hContact, WEATHERCONDITION, "Wind Speed", winfo.wind, SIZEOF(winfo.wind)))
- _tcsncpy(winfo.wind, NODATA, SIZEOF(winfo.wind) - 1);
+ mir_tstrncpy(winfo.wind, NODATA, SIZEOF(winfo.wind) - 1);
if (DBGetStaticString(hContact, WEATHERCONDITION, "Wind Direction", winfo.winddir, SIZEOF(winfo.winddir)))
- _tcsncpy(winfo.winddir, NODATA, SIZEOF(winfo.winddir) - 1);
+ mir_tstrncpy(winfo.winddir, NODATA, SIZEOF(winfo.winddir) - 1);
if (DBGetStaticString(hContact, WEATHERCONDITION, "Dewpoint", winfo.dewpoint, SIZEOF(winfo.dewpoint)))
- _tcsncpy(winfo.dewpoint, NODATA, SIZEOF(winfo.dewpoint) - 1);
+ mir_tstrncpy(winfo.dewpoint, NODATA, SIZEOF(winfo.dewpoint) - 1);
if (DBGetStaticString(hContact, WEATHERCONDITION, "Pressure", winfo.pressure, SIZEOF(winfo.pressure)))
- _tcsncpy(winfo.pressure, NODATA, SIZEOF(winfo.pressure) - 1);
+ mir_tstrncpy(winfo.pressure, NODATA, SIZEOF(winfo.pressure) - 1);
if (DBGetStaticString(hContact, WEATHERCONDITION, "Visibility", winfo.vis, SIZEOF(winfo.vis)))
- _tcsncpy(winfo.vis, NODATA, SIZEOF(winfo.vis) - 1);
+ mir_tstrncpy(winfo.vis, NODATA, SIZEOF(winfo.vis) - 1);
if (DBGetStaticString(hContact, WEATHERCONDITION, "Humidity", winfo.humid, SIZEOF(winfo.humid)))
- _tcsncpy(winfo.humid, NODATA, SIZEOF(winfo.humid) - 1);
+ mir_tstrncpy(winfo.humid, NODATA, SIZEOF(winfo.humid) - 1);
if (DBGetStaticString(hContact, WEATHERCONDITION, "Feel", winfo.feel, SIZEOF(winfo.feel)))
- _tcsncpy(winfo.feel, NODATA, SIZEOF(winfo.feel) - 1);
+ mir_tstrncpy(winfo.feel, NODATA, SIZEOF(winfo.feel) - 1);
winfo.status = (WORD)db_get_w(hContact, WEATHERPROTONAME, "StatusIcon", ID_STATUS_OFFLINE);
return winfo;
@@ -106,7 +106,7 @@ int DBGetStaticString(MCONTACT hContact, const char *szModule, const char *value
if ( db_get_ts( hContact, szModule, valueName, &dbv ))
return 1;
- _tcsncpy( dest, dbv.ptszVal, dest_len );
+ mir_tstrncpy( dest, dbv.ptszVal, dest_len );
dest[ dest_len-1 ] = 0;
db_free( &dbv );
return 0;
@@ -176,7 +176,7 @@ void EraseAllInfo()
// in case where the default station is missing
if (opt.DefStn == NULL && ContactCount != 0) {
if ( !db_get_ts(LastContact, WEATHERPROTONAME, "ID", &dbv)) {
- _tcsncpy(opt.Default, dbv.ptszVal, SIZEOF(opt.Default) - 1);
+ mir_tstrncpy(opt.Default, dbv.ptszVal, SIZEOF(opt.Default) - 1);
db_free(&dbv);
}
opt.DefStn = LastContact;
@@ -340,7 +340,7 @@ void GetDataValue(WIDATAITEM *UpdateData, TCHAR *Data, TCHAR** szData)
mir_sntprintf(Data, MAX_DATA_LEN, TranslateT("Error when obtaining data: %s"), UpdateData->Name);
WPShowMessage(Data, SM_WARNING);
}
- _tcsncpy(Data, TranslateT("<Error>"), MAX_DATA_LEN);
+ mir_tstrncpy(Data, TranslateT("<Error>"), MAX_DATA_LEN);
last = ' ';
respos = MAX_DATA_LEN - 1;
break;
diff --git a/plugins/Weather/src/weather_info.cpp b/plugins/Weather/src/weather_info.cpp
index 39e41637c7..4ceeb921ae 100644
--- a/plugins/Weather/src/weather_info.cpp
+++ b/plugins/Weather/src/weather_info.cpp
@@ -216,7 +216,7 @@ void MoreVarList(void)
TCHAR str[10240], tempstr[1024];
// heading
- _tcsncpy(str, VARS_LIST, SIZEOF(str) - 1);
+ mir_tstrncpy(str, VARS_LIST, SIZEOF(str) - 1);
mir_tstrncat(str, _T("\n\n"), SIZEOF(str) - mir_tstrlen(str));
// loop through all weather services to find custom variables
for (WIDATALIST *Item = WIHead;Item != NULL;Item = Item->next)
diff --git a/plugins/Weather/src/weather_ini.cpp b/plugins/Weather/src/weather_ini.cpp
index d28e24549e..fa689562e0 100644
--- a/plugins/Weather/src/weather_ini.cpp
+++ b/plugins/Weather/src/weather_ini.cpp
@@ -184,7 +184,7 @@ bool LoadWIData(bool dial)
return false;
*chop = '\0';
mir_tstrncat(szSearchPath, _T("\\Plugins\\Weather\\*.ini"), SIZEOF(szSearchPath) - mir_tstrlen(szSearchPath));
- _tcsncpy(FileName, szSearchPath, MAX_PATH - 1);
+ mir_tstrncpy(FileName, szSearchPath, MAX_PATH - 1);
WIN32_FIND_DATA fd;
HANDLE hFind = FindFirstFile(szSearchPath, &fd);
diff --git a/plugins/Weather/src/weather_opt.cpp b/plugins/Weather/src/weather_opt.cpp
index 77cc37b97a..57e6b3fabb 100644
--- a/plugins/Weather/src/weather_opt.cpp
+++ b/plugins/Weather/src/weather_opt.cpp
@@ -36,43 +36,43 @@ void SetTextDefault(const char* in)
TCHAR str[MAX_TEXT_SIZE];
if (strchr(in, 'C') != NULL) {
- _tcsncpy(str, C_DEFAULT, MAX_TEXT_SIZE - 1);
+ mir_tstrncpy(str, C_DEFAULT, MAX_TEXT_SIZE - 1);
wSetData(&opt.cText, str);
}
if (strchr(in, 'b') != NULL) {
- _tcsncpy(str, b_DEFAULT, MAX_TEXT_SIZE - 1);
+ mir_tstrncpy(str, b_DEFAULT, MAX_TEXT_SIZE - 1);
wSetData(&opt.bTitle, str);
}
if (strchr(in, 'B') != NULL) {
- _tcsncpy(str, B_DEFAULT, MAX_TEXT_SIZE - 1);
+ mir_tstrncpy(str, B_DEFAULT, MAX_TEXT_SIZE - 1);
wSetData(&opt.bText, str);
}
if (strchr(in, 'N') != NULL) {
- _tcsncpy(str, N_DEFAULT, MAX_TEXT_SIZE - 1);
+ mir_tstrncpy(str, N_DEFAULT, MAX_TEXT_SIZE - 1);
wSetData(&opt.nText, str);
}
if (strchr(in, 'E') != NULL) {
- _tcsncpy(str, E_DEFAULT, MAX_TEXT_SIZE - 1);
+ mir_tstrncpy(str, E_DEFAULT, MAX_TEXT_SIZE - 1);
wSetData(&opt.eText, str);
}
if (strchr(in, 'H') != NULL) {
- _tcsncpy(str, H_DEFAULT, MAX_TEXT_SIZE - 1);
+ mir_tstrncpy(str, H_DEFAULT, MAX_TEXT_SIZE - 1);
wSetData(&opt.hText, str);
}
if (strchr(in, 'X') != NULL) {
- _tcsncpy(str, X_DEFAULT, MAX_TEXT_SIZE - 1);
+ mir_tstrncpy(str, X_DEFAULT, MAX_TEXT_SIZE - 1);
wSetData(&opt.xText, str);
}
if (strchr(in, 'P') != NULL) {
- _tcsncpy(str, P_DEFAULT, MAX_TEXT_SIZE - 1);
+ mir_tstrncpy(str, P_DEFAULT, MAX_TEXT_SIZE - 1);
wSetData(&opt.pTitle, str);
}
if (strchr(in, 'p') != NULL) {
- _tcsncpy(str, p_DEFAULT, MAX_TEXT_SIZE - 1);
+ mir_tstrncpy(str, p_DEFAULT, MAX_TEXT_SIZE - 1);
wSetData(&opt.pText, str);
}
if (strchr(in, 'S') != NULL) {
- _tcsncpy(str, s_DEFAULT, MAX_TEXT_SIZE - 1);
+ mir_tstrncpy(str, s_DEFAULT, MAX_TEXT_SIZE - 1);
wSetData(&opt.sText, str);
}
}
@@ -472,7 +472,7 @@ INT_PTR CALLBACK DlgProcText(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam)
SetWindowPos(hdlg, HWND_TOPMOST, rc.left, rc.top, 0, 0, SWP_NOSIZE);
TranslateDialogDefault(hdlg);
// generate the display text for variable list
- _tcsncpy(str, VAR_LIST_OPT, SIZEOF(str) - 1);
+ mir_tstrncpy(str, VAR_LIST_OPT, SIZEOF(str) - 1);
SetDlgItemText(hdlg, IDC_VARLIST, str);
// make the more variable and other buttons flat
diff --git a/plugins/Weather/src/weather_popup.cpp b/plugins/Weather/src/weather_popup.cpp
index 17ab3696c8..9abcac9dda 100644
--- a/plugins/Weather/src/weather_popup.cpp
+++ b/plugins/Weather/src/weather_popup.cpp
@@ -79,8 +79,8 @@ int WeatherError(WPARAM wParam, LPARAM lParam)
TCHAR str1[512], str2[512];
// get the 2 strings
- _tcsncpy(str1, tszMsg, SIZEOF(str1) - 1);
- _tcsncpy(str2, tszMsg, SIZEOF(str2) - 1);
+ mir_tstrncpy(str1, tszMsg, SIZEOF(str1) - 1);
+ mir_tstrncpy(str2, tszMsg, SIZEOF(str2) - 1);
TCHAR *chop = _tcschr(str1, 255);
if (chop != NULL)
*chop = '\0';
@@ -88,7 +88,7 @@ int WeatherError(WPARAM wParam, LPARAM lParam)
str1[0] = 0;
chop = _tcschr(str2, 255);
if (chop != NULL)
- _tcsncpy(str2, chop+1, SIZEOF(str2) - 1);
+ mir_tstrncpy(str2, chop+1, SIZEOF(str2) - 1);
else
str2[0] = 0;
@@ -396,7 +396,7 @@ INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam)
case IDC_VAR3:
// display variable list
- _tcsncpy(str, _T(" \n"),SIZEOF(str) - 1); // to make the message box wider
+ mir_tstrncpy(str, _T(" \n"),SIZEOF(str) - 1); // to make the message box wider
mir_tstrncat(str, VAR_LIST_POPUP, SIZEOF(str) - mir_tstrlen(str));
mir_tstrncat(str, _T("\n"), SIZEOF(str) - mir_tstrlen(str));
mir_tstrncat(str, CUSTOM_VARS, SIZEOF(str) - mir_tstrlen(str));
diff --git a/plugins/Weather/src/weather_update.cpp b/plugins/Weather/src/weather_update.cpp
index ed9275e2c4..6a8890b62d 100644
--- a/plugins/Weather/src/weather_update.cpp
+++ b/plugins/Weather/src/weather_update.cpp
@@ -460,7 +460,7 @@ int GetWeatherData(MCONTACT hContact)
// to get a data value.
GetDataValue(&Item->Item, DataValue, &szInfo);
if ( mir_tstrcmp(Item->Item.Name, _T("Condition")) && mir_tstrcmpi(Item->Item.Unit, _T("Cond")))
- _tcsncpy(DataValue, TranslateTS(DataValue), MAX_DATA_LEN - 1);
+ mir_tstrncpy(DataValue, TranslateTS(DataValue), MAX_DATA_LEN - 1);
break;
case WID_SET:
@@ -482,7 +482,7 @@ int GetWeatherData(MCONTACT hContact)
chop = _tcschr(str, '\0');
stl = min(sizeof(str2)-1, (unsigned)(chop-str-2));
- _tcsncpy(str2, str+1, stl);
+ mir_tstrncpy(str2, str+1, stl);
str2[stl] = 0;
switch(str[0]) {
@@ -513,7 +513,7 @@ int GetWeatherData(MCONTACT hContact)
// for the "Break Data=" operation
DBVARIANT dbv;
if ( !DBGetData(hContact, _T2A(Item->Item.Start), &dbv)) {
- _tcsncpy(DataValue, dbv.ptszVal, SIZEOF(DataValue));
+ mir_tstrncpy(DataValue, dbv.ptszVal, SIZEOF(DataValue));
DataValue[SIZEOF(DataValue)-1] = 0;
db_free(&dbv);
}
diff --git a/plugins/Weather/src/weather_userinfo.cpp b/plugins/Weather/src/weather_userinfo.cpp
index befe325ad0..444ee9f135 100644
--- a/plugins/Weather/src/weather_userinfo.cpp
+++ b/plugins/Weather/src/weather_userinfo.cpp
@@ -336,7 +336,7 @@ void LoadBriefInfoText(HWND hwndDlg, MCONTACT hContact)
winfo = LoadWeatherInfo(hContact);
// check if data exist. If not, display error message box
if ( !(BOOL)db_get_b(hContact, WEATHERPROTONAME, "IsUpdated", FALSE))
- _tcsncpy(str, WEATHER_NO_INFO, SIZEOF(str) - 1);
+ mir_tstrncpy(str, WEATHER_NO_INFO, SIZEOF(str) - 1);
else
// set the display text and show the message box
GetDisplay(&winfo, opt.bText, str);