diff options
Diffstat (limited to 'plugins/TipperYM/src')
| -rw-r--r-- | plugins/TipperYM/src/options.cpp | 28 | ||||
| -rw-r--r-- | plugins/TipperYM/src/popwin.cpp | 4 | ||||
| -rw-r--r-- | plugins/TipperYM/src/subst.cpp | 16 | ||||
| -rw-r--r-- | plugins/TipperYM/src/translations.cpp | 12 | 
4 files changed, 30 insertions, 30 deletions
diff --git a/plugins/TipperYM/src/options.cpp b/plugins/TipperYM/src/options.cpp index 14d46e1855..07c8ba99ef 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));
 -			_tcsncpy(di_node->di.swzLabel, _T(""), LABEL_LEN);
 -			_tcsncpy(di_node->di.swzValue, _T(""), VALUE_LEN);
 +			mir_tstrncpy(di_node->di.swzLabel, _T(""), LABEL_LEN);
 +			mir_tstrncpy(di_node->di.swzValue, _T(""), VALUE_LEN);
  			di_node->di.bLineAbove = true;
  			di_node->di.bIsVisible = true;
  			di_node->di.bParseTipperVarsFirst = false;
 @@ -67,7 +67,7 @@ void CreateDefaultItems()  				if (subst == NULL) continue;
  				DSListNode *ds_node = (DSListNode *)mir_alloc(sizeof(DSListNode));
 -				_tcsncpy(ds_node->ds.swzName, subst->swzName, LABEL_LEN);
 +				mir_tstrncpy(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);
  				ds_node->ds.iTranslateFuncId = subst->iTranslateFuncId;
 @@ -77,8 +77,8 @@ void CreateDefaultItems()  			}
  			DIListNode *di_node = (DIListNode *)mir_alloc(sizeof(DIListNode));
 -			_tcsncpy(di_node->di.swzLabel, TranslateTS(item->swzLabel), LABEL_LEN);
 -			_tcsncpy(di_node->di.swzValue, item->swzValue, VALUE_LEN);
 +			mir_tstrncpy(di_node->di.swzLabel, TranslateTS(item->swzLabel), LABEL_LEN);
 +			mir_tstrncpy(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;
 -	_tcsncpy(ds->swzName, dbv.ptszVal, SIZEOF(ds->swzName));
 +	mir_tstrncpy(ds->swzName, dbv.ptszVal, SIZEOF(ds->swzName));
  	ds->swzName[SIZEOF(ds->swzName) - 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;
 -	_tcsncpy(di->swzLabel, dbv.ptszVal, SIZEOF(di->swzLabel));
 +	mir_tstrncpy(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)) {
 -		_tcsncpy(di->swzValue, dbv.ptszVal, SIZEOF(di->swzValue));
 +		mir_tstrncpy(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;
  		}
 -		_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);
 +		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);
  		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;
  		}
 -		_tcsncpy(di_node->di.swzLabel, _T("Status message:"), LABEL_LEN);
 -		_tcsncpy(di_node->di.swzValue, _T("%sys:status_msg%"), VALUE_LEN);
 +		mir_tstrncpy(di_node->di.swzLabel, _T("Status message:"), LABEL_LEN);
 +		mir_tstrncpy(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)) {
 -			_tcsncpy(opt.szSkinName, dbv.ptszVal, SIZEOF(opt.szSkinName) - 1);
 +			mir_tstrncpy(opt.szSkinName, dbv.ptszVal, SIZEOF(opt.szSkinName) - 1);
  			db_free(&dbv);
  		}
  	}
 @@ -907,7 +907,7 @@ 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;
 -									_tcsncpy(ds_value->ds.swzName, subst->swzName, LABEL_LEN - 1);
 +									mir_tstrncpy(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);
 diff --git a/plugins/TipperYM/src/popwin.cpp b/plugins/TipperYM/src/popwin.cpp index 11fa12f1e5..24377573bf 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); -				_tcsncpy(pwd->swzTitle, swzNick, TITLE_TEXT_LEN); +				mir_tstrncpy(pwd->swzTitle, swzNick, TITLE_TEXT_LEN);  				char *szProto = GetContactProto(pwd->hContact);  				pwd->spiTitle = Smileys_PreParse(pwd->swzTitle, -1, szProto); @@ -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) { -							_tcsncpy(buff, pwd->rows[i].swzValue, MAX_VALUE_LEN); +							mir_tstrncpy(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 998694c0e6..91740cf8af 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) { -				_tcsncpy(buff, pa->tszAccountName, bufflen); +				mir_tstrncpy(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) { -			_tcsncpy(buff, swzMsg, bufflen); +			mir_tstrncpy(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) { -			_tcsncpy(buff, swzMsg, bufflen); +			mir_tstrncpy(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) _tcsncpy(buff, swzNick, bufflen); +		if (swzNick) mir_tstrncpy(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 { -							_tcsncpy(swzAlt, p, VALUE_LEN); +							mir_tstrncpy(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); -					_tcsncpy(&swzDest[di], swzRep, min(rep_len, iDestLen - di)); +					mir_tstrncpy(&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); -					_tcsncpy(&swzDest[di], swzAlt, min(alt_len, iDestLen - di)); +					mir_tstrncpy(&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); -		_tcsncpy(swzDest, swzVarSrc, iDestLen); +		mir_tstrncpy(swzDest, swzVarSrc, iDestLen);  		mir_free(swzVarSrc);  	} diff --git a/plugins/TipperYM/src/translations.cpp b/plugins/TipperYM/src/translations.cpp index 12ac692831..1d60bb3970 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)
 -				_tcsncpy(buff, _T("Yes"), bufflen);
 +				mir_tstrncpy(buff, _T("Yes"), bufflen);
  			else
 -				_tcsncpy(buff, _T("No"), bufflen);
 +				mir_tstrncpy(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')
 -		_tcsncpy(buff, TranslateT("Female"), bufflen);
 +		mir_tstrncpy(buff, TranslateT("Female"), bufflen);
  	else if (val == 'M')
 -		_tcsncpy(buff, TranslateT("Male"), bufflen);
 +		mir_tstrncpy(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))
  		{
 -			_tcsncpy(buff, TranslateTS(dbv.ptszVal), bufflen);
 +			mir_tstrncpy(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;
 -		_tcsncpy(buff, TranslateTS(szDefaultName), bufflen);
 +		mir_tstrncpy(buff, TranslateTS(szDefaultName), bufflen);
  		buff[bufflen - 1] = 0;
  		return buff;
  	} 
  | 
