summaryrefslogtreecommitdiff
path: root/plugins/TipperYM/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-05-23 18:55:59 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-05-23 18:55:59 +0000
commit2a815f8820ca402626bd283dd5b75744ddeb9812 (patch)
treeb230e7ac7d0330f5a1a0c8891d0a7dda9c5b47c6 /plugins/TipperYM/src
parent9a177a4e355c52775b580ad5687db2120f9282d5 (diff)
mir_tstrncpy <> _tcsncpy
git-svn-id: http://svn.miranda-ng.org/main/trunk@13791 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TipperYM/src')
-rw-r--r--plugins/TipperYM/src/mir_smileys.cpp6
-rw-r--r--plugins/TipperYM/src/options.cpp38
-rw-r--r--plugins/TipperYM/src/popwin.cpp8
-rw-r--r--plugins/TipperYM/src/subst.cpp16
-rw-r--r--plugins/TipperYM/src/translations.cpp12
5 files changed, 40 insertions, 40 deletions
diff --git a/plugins/TipperYM/src/mir_smileys.cpp b/plugins/TipperYM/src/mir_smileys.cpp
index 6fd7cbf805..a6ac7e8cd9 100644
--- a/plugins/TipperYM/src/mir_smileys.cpp
+++ b/plugins/TipperYM/src/mir_smileys.cpp
@@ -314,11 +314,11 @@ SortedList *ReplaceSmileys(const TCHAR *text, int text_size, const char *protoco
char smileyProto[64];
if (protocol == NULL)
- mir_strncpy(smileyProto, "tipper", sizeof(smileyProto) - 1);
+ strncpy(smileyProto, "tipper", sizeof(smileyProto) - 1);
else if (mir_strcmp(protocol, META_PROTO) == 0)
- mir_strncpy(smileyProto, "tipper", sizeof(smileyProto) - 1);
+ strncpy(smileyProto, "tipper", sizeof(smileyProto) - 1);
else
- mir_strncpy(smileyProto, protocol, sizeof(smileyProto) - 1);
+ strncpy(smileyProto, protocol, sizeof(smileyProto) - 1);
// Parse it!
SMADD_BATCHPARSE2 sp = { 0 };
diff --git a/plugins/TipperYM/src/options.cpp b/plugins/TipperYM/src/options.cpp
index 07c8ba99ef..85ca77b699 100644
--- a/plugins/TipperYM/src/options.cpp
+++ b/plugins/TipperYM/src/options.cpp
@@ -49,8 +49,8 @@ void CreateDefaultItems()
for (int i = 0; defaultItemList[i].szName; i++) {
if (defaultItemList[i].szName[0] == '-') {
DIListNode *di_node = (DIListNode *)mir_alloc(sizeof(DIListNode));
- mir_tstrncpy(di_node->di.swzLabel, _T(""), LABEL_LEN);
- mir_tstrncpy(di_node->di.swzValue, _T(""), VALUE_LEN);
+ _tcsncpy(di_node->di.swzLabel, _T(""), LABEL_LEN);
+ _tcsncpy(di_node->di.swzValue, _T(""), VALUE_LEN);
di_node->di.bLineAbove = true;
di_node->di.bIsVisible = true;
di_node->di.bParseTipperVarsFirst = false;
@@ -67,9 +67,9 @@ void CreateDefaultItems()
if (subst == NULL) continue;
DSListNode *ds_node = (DSListNode *)mir_alloc(sizeof(DSListNode));
- mir_tstrncpy(ds_node->ds.swzName, subst->swzName, LABEL_LEN);
+ _tcsncpy(ds_node->ds.swzName, subst->swzName, LABEL_LEN);
ds_node->ds.type = subst->type;
- mir_strncpy(ds_node->ds.szSettingName, subst->szSettingName, SETTING_NAME_LEN);
+ strncpy(ds_node->ds.szSettingName, subst->szSettingName, SETTING_NAME_LEN);
ds_node->ds.iTranslateFuncId = subst->iTranslateFuncId;
ds_node->next = opt.dsList;
opt.dsList = ds_node;
@@ -77,8 +77,8 @@ void CreateDefaultItems()
}
DIListNode *di_node = (DIListNode *)mir_alloc(sizeof(DIListNode));
- mir_tstrncpy(di_node->di.swzLabel, TranslateTS(item->swzLabel), LABEL_LEN);
- mir_tstrncpy(di_node->di.swzValue, item->swzValue, VALUE_LEN);
+ _tcsncpy(di_node->di.swzLabel, TranslateTS(item->swzLabel), LABEL_LEN);
+ _tcsncpy(di_node->di.swzValue, item->swzValue, VALUE_LEN);
di_node->di.bLineAbove = false;
di_node->di.bValueNewline = defaultItemList[i].bValueNewline;
di_node->di.bIsVisible = true;
@@ -100,7 +100,7 @@ bool LoadDS(DISPLAYSUBST *ds, int index)
if (db_get_ts(0, MODULE_ITEMS, setting, &dbv))
return false;
- mir_tstrncpy(ds->swzName, dbv.ptszVal, SIZEOF(ds->swzName));
+ _tcsncpy(ds->swzName, dbv.ptszVal, SIZEOF(ds->swzName));
ds->swzName[SIZEOF(ds->swzName) - 1] = 0;
db_free(&dbv);
@@ -110,7 +110,7 @@ bool LoadDS(DISPLAYSUBST *ds, int index)
mir_snprintf(setting, SIZEOF(setting), "Module%d", index);
ds->szModuleName[0] = 0;
if (!db_get(0, MODULE_ITEMS, setting, &dbv)) {
- mir_strncpy(ds->szModuleName, dbv.pszVal, MODULE_NAME_LEN);
+ strncpy(ds->szModuleName, dbv.pszVal, MODULE_NAME_LEN);
ds->szModuleName[MODULE_NAME_LEN - 1] = 0;
db_free(&dbv);
}
@@ -118,7 +118,7 @@ bool LoadDS(DISPLAYSUBST *ds, int index)
mir_snprintf(setting, SIZEOF(setting), "Setting%d", index);
ds->szSettingName[0] = 0;
if (!db_get(0, MODULE_ITEMS, setting, &dbv)) {
- mir_strncpy(ds->szSettingName, dbv.pszVal, SETTING_NAME_LEN);
+ strncpy(ds->szSettingName, dbv.pszVal, SETTING_NAME_LEN);
ds->szSettingName[SETTING_NAME_LEN - 1] = 0;
db_free(&dbv);
}
@@ -161,14 +161,14 @@ bool LoadDI(DISPLAYITEM *di, int index)
if (db_get_ts(0, MODULE_ITEMS, setting, &dbv))
return false;
- mir_tstrncpy(di->swzLabel, dbv.ptszVal, SIZEOF(di->swzLabel));
+ _tcsncpy(di->swzLabel, dbv.ptszVal, SIZEOF(di->swzLabel));
di->swzLabel[SIZEOF(di->swzLabel) - 1] = 0;
db_free(&dbv);
mir_snprintf(setting, SIZEOF(setting), "DIValue%d", index);
di->swzValue[0] = 0;
if (!db_get_ts(0, MODULE_ITEMS, setting, &dbv)) {
- mir_tstrncpy(di->swzValue, dbv.ptszVal, SIZEOF(di->swzValue));
+ _tcsncpy(di->swzValue, dbv.ptszVal, SIZEOF(di->swzValue));
di->swzValue[SIZEOF(di->swzValue) - 1] = 0;
db_free(&dbv);
}
@@ -411,8 +411,8 @@ void LoadOptions()
di_node = opt.diList;
}
- mir_tstrncpy(di_node->di.swzLabel, _T("Last message: (%sys:last_msg_reltime% ago)"), LABEL_LEN);
- mir_tstrncpy(di_node->di.swzValue, _T("%sys:last_msg%"), VALUE_LEN);
+ _tcsncpy(di_node->di.swzLabel, _T("Last message: (%sys:last_msg_reltime% ago)"), LABEL_LEN);
+ _tcsncpy(di_node->di.swzValue, _T("%sys:last_msg%"), VALUE_LEN);
di_node->di.bLineAbove = di_node->di.bValueNewline = true;
di_node->next = 0;
opt.iDiCount++;
@@ -436,8 +436,8 @@ void LoadOptions()
di_node = opt.diList;
}
- mir_tstrncpy(di_node->di.swzLabel, _T("Status message:"), LABEL_LEN);
- mir_tstrncpy(di_node->di.swzValue, _T("%sys:status_msg%"), VALUE_LEN);
+ _tcsncpy(di_node->di.swzLabel, _T("Status message:"), LABEL_LEN);
+ _tcsncpy(di_node->di.swzValue, _T("%sys:status_msg%"), VALUE_LEN);
di_node->di.bLineAbove = di_node->di.bValueNewline = true;
di_node->next = 0;
opt.iDiCount++;
@@ -516,7 +516,7 @@ void LoadOptions()
}
else if (opt.skinMode == SM_IMAGE) {
if (!db_get_ts(NULL, MODULE, "SkinName", &dbv)) {
- mir_tstrncpy(opt.szSkinName, dbv.ptszVal, SIZEOF(opt.szSkinName) - 1);
+ _tcsncpy(opt.szSkinName, dbv.ptszVal, SIZEOF(opt.szSkinName) - 1);
db_free(&dbv);
}
}
@@ -907,13 +907,13 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
memset(ds_value, 0, sizeof(DSListNode));
ds_value->next = NULL;
ds_value->ds.type = subst->type;
- mir_tstrncpy(ds_value->ds.swzName, subst->swzName, LABEL_LEN - 1);
+ _tcsncpy(ds_value->ds.swzName, subst->swzName, LABEL_LEN - 1);
if (ds_value->ds.type == DVT_DB && subst->szModuleName)
- mir_strncpy(ds_value->ds.szModuleName, subst->szModuleName, MODULE_NAME_LEN - 1);
+ strncpy(ds_value->ds.szModuleName, subst->szModuleName, MODULE_NAME_LEN - 1);
if (subst->szSettingName)
- mir_strncpy(ds_value->ds.szSettingName, subst->szSettingName, SETTING_NAME_LEN - 1);
+ strncpy(ds_value->ds.szSettingName, subst->szSettingName, SETTING_NAME_LEN - 1);
ds_value->ds.iTranslateFuncId = subst->iTranslateFuncId;
diff --git a/plugins/TipperYM/src/popwin.cpp b/plugins/TipperYM/src/popwin.cpp
index 24377573bf..1396836639 100644
--- a/plugins/TipperYM/src/popwin.cpp
+++ b/plugins/TipperYM/src/popwin.cpp
@@ -314,7 +314,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
db_unset(pwd->hContact, MODULE, "TempStatusMsg");
TCHAR *swzNick = pcli->pfnGetContactDisplayName(pwd->hContact, 0);
- mir_tstrncpy(pwd->swzTitle, swzNick, TITLE_TEXT_LEN);
+ _tcsncpy(pwd->swzTitle, swzNick, TITLE_TEXT_LEN);
char *szProto = GetContactProto(pwd->hContact);
pwd->spiTitle = Smileys_PreParse(pwd->swzTitle, -1, szProto);
@@ -338,9 +338,9 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
if (iXstatus) {
char szIconProto[64];
if (mir_strcmp(szProto, META_PROTO) != 0)
- mir_strncpy(szIconProto, szProto, sizeof(szIconProto) - 1);
+ strncpy(szIconProto, szProto, sizeof(szIconProto) - 1);
else if (!db_get_s(pwd->hContact, szProto, "XStatusProto", &dbv)) {
- mir_strncpy(szIconProto, dbv.pszVal, sizeof(szIconProto) - 1);
+ strncpy(szIconProto, dbv.pszVal, sizeof(szIconProto) - 1);
db_free(&dbv);
}
@@ -775,7 +775,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
int iLen = (int)mir_tstrlen(pwd->rows[i].swzValue);
if (iLen) {
if (iLen > MAX_VALUE_LEN) {
- mir_tstrncpy(buff, pwd->rows[i].swzValue, MAX_VALUE_LEN);
+ _tcsncpy(buff, pwd->rows[i].swzValue, MAX_VALUE_LEN);
buff[MAX_VALUE_LEN] = 0;
mir_tstrcat(buff, _T("..."));
}
diff --git a/plugins/TipperYM/src/subst.cpp b/plugins/TipperYM/src/subst.cpp
index 91740cf8af..998694c0e6 100644
--- a/plugins/TipperYM/src/subst.cpp
+++ b/plugins/TipperYM/src/subst.cpp
@@ -272,7 +272,7 @@ bool GetSysSubstText(MCONTACT hContact, TCHAR *swzRawSpec, TCHAR *buff, int buff
else if (szProto) {
PROTOACCOUNT *pa = ProtoGetAccount(szProto);
if (pa && pa->tszAccountName) {
- mir_tstrncpy(buff, pa->tszAccountName, bufflen);
+ _tcsncpy(buff, pa->tszAccountName, bufflen);
return true;
}
else
@@ -290,7 +290,7 @@ bool GetSysSubstText(MCONTACT hContact, TCHAR *swzRawSpec, TCHAR *buff, int buff
else if (!mir_tstrcmp(swzRawSpec, _T("status_msg"))) {
TCHAR *swzMsg = GetStatusMessageText(hContact);
if (swzMsg) {
- mir_tstrncpy(buff, swzMsg, bufflen);
+ _tcsncpy(buff, swzMsg, bufflen);
mir_free(swzMsg);
return true;
}
@@ -298,7 +298,7 @@ bool GetSysSubstText(MCONTACT hContact, TCHAR *swzRawSpec, TCHAR *buff, int buff
else if ((recv = !mir_tstrcmp(swzRawSpec, _T("last_msg"))) || !mir_tstrcmp(swzRawSpec, _T("last_msg_out"))) {
TCHAR *swzMsg = GetLastMessageText(hContact, recv);
if (swzMsg) {
- mir_tstrncpy(buff, swzMsg, bufflen);
+ _tcsncpy(buff, swzMsg, bufflen);
mir_free(swzMsg);
return true;
}
@@ -310,7 +310,7 @@ bool GetSysSubstText(MCONTACT hContact, TCHAR *swzRawSpec, TCHAR *buff, int buff
return false;
TCHAR *swzNick = (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hSubContact, GCDNF_TCHAR);
- if (swzNick) mir_tstrncpy(buff, swzNick, bufflen);
+ if (swzNick) _tcsncpy(buff, swzNick, bufflen);
return true;
}
else if (!mir_tstrcmp(swzRawSpec, _T("meta_subuid"))) {
@@ -581,7 +581,7 @@ bool ApplySubst(MCONTACT hContact, const TCHAR *swzSource, bool parseTipperVarsF
if (ds_node)
GetSubstText(hContact, ds_node->ds, swzAlt, VALUE_LEN);
else {
- mir_tstrncpy(swzAlt, p, VALUE_LEN);
+ _tcsncpy(swzAlt, p, VALUE_LEN);
bAltSubst = true;
}
}
@@ -619,12 +619,12 @@ bool ApplySubst(MCONTACT hContact, const TCHAR *swzSource, bool parseTipperVarsF
if (bSubst) {
size_t rep_len = mir_tstrlen(swzRep);
- mir_tstrncpy(&swzDest[di], swzRep, min(rep_len, iDestLen - di));
+ _tcsncpy(&swzDest[di], swzRep, min(rep_len, iDestLen - di));
di += rep_len - 1; // -1 because we inc at bottom of loop
}
else if (bAltSubst) {
size_t alt_len = mir_tstrlen(swzAlt);
- mir_tstrncpy(&swzDest[di], swzAlt, min(alt_len, iDestLen - di));
+ _tcsncpy(&swzDest[di], swzAlt, min(alt_len, iDestLen - di));
di += alt_len - 1; // -1 because we inc at bottom of loop
}
else goto empty; // empty value
@@ -643,7 +643,7 @@ bool ApplySubst(MCONTACT hContact, const TCHAR *swzSource, bool parseTipperVarsF
if (parseTipperVarsFirst) {
swzVarSrc = variables_parsedup(swzDest, 0, hContact);
- mir_tstrncpy(swzDest, swzVarSrc, iDestLen);
+ _tcsncpy(swzDest, swzVarSrc, iDestLen);
mir_free(swzVarSrc);
}
diff --git a/plugins/TipperYM/src/translations.cpp b/plugins/TipperYM/src/translations.cpp
index 1d60bb3970..12ac692831 100644
--- a/plugins/TipperYM/src/translations.cpp
+++ b/plugins/TipperYM/src/translations.cpp
@@ -174,9 +174,9 @@ TCHAR *ByteToYesNo(MCONTACT hContact, const char *szModuleName, const char *szSe
if (dbv.type == DBVT_BYTE)
{
if (dbv.bVal != 0)
- mir_tstrncpy(buff, _T("Yes"), bufflen);
+ _tcsncpy(buff, _T("Yes"), bufflen);
else
- mir_tstrncpy(buff, _T("No"), bufflen);
+ _tcsncpy(buff, _T("No"), bufflen);
buff[bufflen - 1] = 0;
db_free(&dbv);
return buff;
@@ -190,9 +190,9 @@ TCHAR *ByteToGender(MCONTACT hContact, const char *szModuleName, const char *szS
{
BYTE val = (BYTE)db_get_b(hContact, szModuleName, szSettingName, 0);
if (val == 'F')
- mir_tstrncpy(buff, TranslateT("Female"), bufflen);
+ _tcsncpy(buff, TranslateT("Female"), bufflen);
else if (val == 'M')
- mir_tstrncpy(buff, TranslateT("Male"), bufflen);
+ _tcsncpy(buff, TranslateT("Male"), bufflen);
else
return 0;
@@ -588,7 +588,7 @@ TCHAR *EmptyXStatusToDefaultName(MCONTACT hContact, const char *szModuleName, co
{
if (!db_get_ts(hContact, szModuleName, szSettingName, &dbv))
{
- mir_tstrncpy(buff, TranslateTS(dbv.ptszVal), bufflen);
+ _tcsncpy(buff, TranslateTS(dbv.ptszVal), bufflen);
buff[bufflen - 1] = 0;
return buff;
}
@@ -609,7 +609,7 @@ TCHAR *EmptyXStatusToDefaultName(MCONTACT hContact, const char *szModuleName, co
if (CallProtoService(szModuleName, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus))
return 0;
- mir_tstrncpy(buff, TranslateTS(szDefaultName), bufflen);
+ _tcsncpy(buff, TranslateTS(szDefaultName), bufflen);
buff[bufflen - 1] = 0;
return buff;
}