summaryrefslogtreecommitdiff
path: root/protocols/Tlen/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 /protocols/Tlen/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 'protocols/Tlen/src')
-rw-r--r--protocols/Tlen/src/tlen.cpp2
-rw-r--r--protocols/Tlen/src/tlen_file.cpp2
-rw-r--r--protocols/Tlen/src/tlen_opt.cpp4
-rw-r--r--protocols/Tlen/src/tlen_p2p_old.cpp6
-rw-r--r--protocols/Tlen/src/tlen_svc.cpp2
-rw-r--r--protocols/Tlen/src/tlen_thread.cpp18
-rw-r--r--protocols/Tlen/src/tlen_util.cpp6
-rw-r--r--protocols/Tlen/src/tlen_voice.cpp4
-rw-r--r--protocols/Tlen/src/tlen_xml.cpp20
9 files changed, 32 insertions, 32 deletions
diff --git a/protocols/Tlen/src/tlen.cpp b/protocols/Tlen/src/tlen.cpp
index e82ddbc75f..e87fcac01d 100644
--- a/protocols/Tlen/src/tlen.cpp
+++ b/protocols/Tlen/src/tlen.cpp
@@ -214,7 +214,7 @@ INT_PTR TlenProtocol::MenuHandleInbox(WPARAM wParam, LPARAM lParam)
if (end == NULL) {
end = resp->headers[i].szValue + mir_strlen(resp->headers[i].szValue);
}
- mir_strncpy(cookie, start, (end - start));
+ strncpy(cookie, start, (end - start));
break;
}
}
diff --git a/protocols/Tlen/src/tlen_file.cpp b/protocols/Tlen/src/tlen_file.cpp
index fb58de29c0..71ad60185f 100644
--- a/protocols/Tlen/src/tlen_file.cpp
+++ b/protocols/Tlen/src/tlen_file.cpp
@@ -578,7 +578,7 @@ void TlenProcessF(XmlNode *node, ThreadData *info)
if (numFiles == 1) {
if ((p=TlenXmlGetAttrValue(node, "n")) != NULL) {
p = TlenTextDecode(p);
- mir_strncpy(szFilename, p, sizeof(szFilename)-1);
+ strncpy(szFilename, p, sizeof(szFilename)-1);
mir_free(p);
} else {
mir_strcpy(szFilename, Translate("1 File"));
diff --git a/protocols/Tlen/src/tlen_opt.cpp b/protocols/Tlen/src/tlen_opt.cpp
index a710bc6cd2..6442ecf019 100644
--- a/protocols/Tlen/src/tlen_opt.cpp
+++ b/protocols/Tlen/src/tlen_opt.cpp
@@ -602,8 +602,8 @@ static void MailPopupPreview(DWORD colorBack, DWORD colorText, TCHAR *title, TCH
HICON hIcon = GetIcolibIcon(IDI_MAIL);
ppd.lchIcon = CopyIcon(hIcon);
ReleaseIcolibIcon(hIcon);
- mir_tstrncpy(ppd.lptzContactName, title, MAX_CONTACTNAME-1);
- mir_tstrncpy(ppd.lptzText, emailInfo,MAX_SECONDLINE-1);
+ _tcsncpy(ppd.lptzContactName, title, MAX_CONTACTNAME-1);
+ _tcsncpy(ppd.lptzText, emailInfo,MAX_SECONDLINE-1);
ppd.colorBack = colorBack;
ppd.colorText = colorText;
ppd.iSeconds = delay;
diff --git a/protocols/Tlen/src/tlen_p2p_old.cpp b/protocols/Tlen/src/tlen_p2p_old.cpp
index 51499497f3..cb72d33849 100644
--- a/protocols/Tlen/src/tlen_p2p_old.cpp
+++ b/protocols/Tlen/src/tlen_p2p_old.cpp
@@ -334,7 +334,7 @@ static HANDLE TlenP2PBindSocks4(SOCKSBIND * sb, TLEN_FILE_TRANSFER *ft)
return NULL;
}
in.S_un.S_addr = *(PDWORD)(buf+4);
- mir_strncpy(sb->szHost, inet_ntoa(in), sizeof(sb->szHost)-1);
+ strncpy(sb->szHost, inet_ntoa(in), sizeof(sb->szHost)-1);
sb->wPort = htons(*(PWORD)(buf+2));
ft->s = s;
forkthread((void (__cdecl *)(void*))TlenFileBindSocks4Thread, 0, ft);
@@ -463,11 +463,11 @@ HANDLE TlenP2PListen(TLEN_FILE_TRANSFER *ft)
if (db_get_b(NULL, proto->m_szModuleName, "FileProxyAuth", FALSE)) {
sb.useAuth = TRUE;
if (!db_get_s(NULL, proto->m_szModuleName, "FileProxyUsername", &dbv)) {
- mir_strncpy(sb.szUser, dbv.pszVal, sizeof(sb.szUser)-1);
+ strncpy(sb.szUser, dbv.pszVal, sizeof(sb.szUser)-1);
db_free(&dbv);
}
if (!db_get_s(NULL, proto->m_szModuleName, "FileProxyPassword", &dbv)) {
- mir_strncpy(sb.szPassword, dbv.pszVal, sizeof(sb.szPassword)-1);
+ strncpy(sb.szPassword, dbv.pszVal, sizeof(sb.szPassword)-1);
db_free(&dbv);
}
}
diff --git a/protocols/Tlen/src/tlen_svc.cpp b/protocols/Tlen/src/tlen_svc.cpp
index 487302c7fd..705b4ca150 100644
--- a/protocols/Tlen/src/tlen_svc.cpp
+++ b/protocols/Tlen/src/tlen_svc.cpp
@@ -55,7 +55,7 @@ DWORD_PTR TlenProtocol::GetCaps(int type, MCONTACT hContact)
INT_PTR TlenProtocol::GetName(WPARAM wParam, LPARAM lParam)
{
- mir_strncpy((char*)lParam, m_szModuleName, wParam);
+ strncpy((char*)lParam, m_szModuleName, wParam);
return 0;
}
diff --git a/protocols/Tlen/src/tlen_thread.cpp b/protocols/Tlen/src/tlen_thread.cpp
index d3eb3ddab4..f614b0a323 100644
--- a/protocols/Tlen/src/tlen_thread.cpp
+++ b/protocols/Tlen/src/tlen_thread.cpp
@@ -130,7 +130,7 @@ void __cdecl TlenServerThread(ThreadData *info)
DBVARIANT dbv;
if (!db_get(NULL, info->proto->m_szModuleName, "LoginName", &dbv)) {
- mir_strncpy(info->username, dbv.pszVal, sizeof(info->username));
+ strncpy(info->username, dbv.pszVal, sizeof(info->username));
info->username[sizeof(info->username)-1] = '\0';
_strlwr(info->username);
db_set_s(NULL, info->proto->m_szModuleName, "LoginName", info->username);
@@ -143,7 +143,7 @@ void __cdecl TlenServerThread(ThreadData *info)
if (loginErr == 0) {
if (!db_get(NULL, info->proto->m_szModuleName, "LoginServer", &dbv)) {
- mir_strncpy(info->server, dbv.pszVal, sizeof(info->server));
+ strncpy(info->server, dbv.pszVal, sizeof(info->server));
info->server[sizeof(info->server)-1] = '\0';
_strlwr(info->server);
db_set_s(NULL, info->proto->m_szModuleName, "LoginServer", info->server);
@@ -168,7 +168,7 @@ void __cdecl TlenServerThread(ThreadData *info)
CloseHandle(hEventPasswdDlg);
if (onlinePassword[0] != (char) -1) {
- mir_strncpy(info->password, onlinePassword, sizeof(info->password));
+ strncpy(info->password, onlinePassword, sizeof(info->password));
info->password[sizeof(info->password)-1] = '\0';
}
else {
@@ -178,7 +178,7 @@ void __cdecl TlenServerThread(ThreadData *info)
}
else {
if (!db_get(NULL, info->proto->m_szModuleName, "Password", &dbv)) {
- mir_strncpy(info->password, dbv.pszVal, sizeof(info->password));
+ strncpy(info->password, dbv.pszVal, sizeof(info->password));
info->password[sizeof(info->password)-1] = '\0';
db_free(&dbv);
}
@@ -211,7 +211,7 @@ void __cdecl TlenServerThread(ThreadData *info)
db_set_s(NULL, info->proto->m_szModuleName, "jid", jidStr);
if (!db_get(NULL, info->proto->m_szModuleName, "ManualHost", &dbv)) {
- mir_strncpy(info->manualHost, dbv.pszVal, sizeof(info->manualHost));
+ strncpy(info->manualHost, dbv.pszVal, sizeof(info->manualHost));
info->manualHost[sizeof(info->manualHost)-1] = '\0';
db_free(&dbv);
}
@@ -227,7 +227,7 @@ void __cdecl TlenServerThread(ThreadData *info)
if (!db_get(NULL, info->proto->m_szModuleName, "AvatarHash", &dbv)) {
- mir_strncpy(info->proto->threadData->avatarHash, dbv.pszVal, sizeof(info->proto->threadData->avatarHash)-1);
+ strncpy(info->proto->threadData->avatarHash, dbv.pszVal, sizeof(info->proto->threadData->avatarHash)-1);
db_free(&dbv);
}
info->avatarFormat = db_get_dw(NULL, info->proto->m_szModuleName, "AvatarFormat", PA_FORMAT_UNKNOWN);
@@ -587,7 +587,7 @@ static void TlenProcessAvatar(XmlNode* node, ThreadData *info)
XmlNode *aNode = TlenXmlGetChild(node, "a");
if (tokenNode != NULL) {
char *token = tokenNode->text;
- mir_strncpy(info->avatarToken, token, sizeof(info->avatarToken)-1);
+ strncpy(info->avatarToken, token, sizeof(info->avatarToken)-1);
}
if (aNode != NULL) {
if (TlenProcessAvatarNode(info->proto, node, NULL)) {
@@ -1063,8 +1063,8 @@ static void TlenMailPopup(TlenProtocol *proto, char *title, char *emailInfo)
POPUPDATAT ppd = { 0 };
ppd.lchIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_MAIL));
- mir_tstrncpy(ppd.lptzContactName, _A2T(title), MAX_CONTACTNAME -1);
- mir_tstrncpy(ppd.lptzText, _A2T(emailInfo), MAX_SECONDLINE - 1);
+ _tcsncpy(ppd.lptzContactName, _A2T(title), MAX_CONTACTNAME -1);
+ _tcsncpy(ppd.lptzText, _A2T(emailInfo), MAX_SECONDLINE - 1);
ppd.colorBack = db_get_dw(NULL, proto->m_szModuleName, "MailPopupBack", 0);
ppd.colorText = db_get_dw(NULL, proto->m_szModuleName, "MailPopupText", 0);
BYTE delayMode = db_get_b(NULL, proto->m_szModuleName, "MailPopupDelayMode", 0);
diff --git a/protocols/Tlen/src/tlen_util.cpp b/protocols/Tlen/src/tlen_util.cpp
index 61bde3433d..f315a3e177 100644
--- a/protocols/Tlen/src/tlen_util.cpp
+++ b/protocols/Tlen/src/tlen_util.cpp
@@ -85,7 +85,7 @@ char *TlenResourceFromJID(const char *jid2)
if (p != NULL && p[1] != '\0') {
p++;
if ((nick=(char *) mir_alloc(1+mir_strlen(jid)-(p-jid))) != NULL) {
- mir_strncpy(nick, p, mir_strlen(jid)-(p-jid));
+ strncpy(nick, p, mir_strlen(jid)-(p-jid));
nick[mir_strlen(jid)-(p-jid)] = '\0';
}
}
@@ -107,7 +107,7 @@ char *TlenNickFromJID(const char *jid2)
p = strchr(jid, '/');
if (p != NULL) {
if ((nick=(char *) mir_alloc((p-jid)+1)) != NULL) {
- mir_strncpy(nick, jid, p-jid);
+ strncpy(nick, jid, p-jid);
nick[p-jid] = '\0';
}
}
@@ -128,7 +128,7 @@ char *TlenLoginFromJID(const char *jid2)
p = strchr(jid, '/');
if (p != NULL) {
if ((nick=(char *) mir_alloc((p-jid)+1)) != NULL) {
- mir_strncpy(nick, jid, p-jid);
+ strncpy(nick, jid, p-jid);
nick[p-jid] = '\0';
}
}
diff --git a/protocols/Tlen/src/tlen_voice.cpp b/protocols/Tlen/src/tlen_voice.cpp
index 1c4149c8ae..70bf723c23 100644
--- a/protocols/Tlen/src/tlen_voice.cpp
+++ b/protocols/Tlen/src/tlen_voice.cpp
@@ -1016,7 +1016,7 @@ int TlenVoiceAccept(TlenProtocol *proto, const char *id, const char *from)
db_free(&dbv);
}
else {
- mir_strncpy(jid, from, SIZEOF(jid) - 1);
+ strncpy(jid, from, SIZEOF(jid) - 1);
}
ignore = !IsAuthorized(proto, jid);
ask = true;
@@ -1029,7 +1029,7 @@ int TlenVoiceAccept(TlenProtocol *proto, const char *id, const char *from)
db_free(&dbv);
}
else {
- mir_strncpy(jid, from, SIZEOF(jid) - 1);
+ strncpy(jid, from, SIZEOF(jid) - 1);
}
ask = !IsAuthorized(proto, jid);
ignore = false;
diff --git a/protocols/Tlen/src/tlen_xml.cpp b/protocols/Tlen/src/tlen_xml.cpp
index 5939c65d58..408df2ab3a 100644
--- a/protocols/Tlen/src/tlen_xml.cpp
+++ b/protocols/Tlen/src/tlen_xml.cpp
@@ -126,18 +126,18 @@ int TlenXmlParse(XmlState *xmlState, char *buffer, int datalen)
}
else {
if (*(p+1) == '/') { // closing tag
- mir_strncpy(tag, p+2, r-(p+2));
+ strncpy(tag, p+2, r-(p+2));
tag[r-(p+2)] = '\0';
elemType = ELEM_CLOSE;
}
else {
if (*(r-1) == '/') { // single open/close tag
- mir_strncpy(tag, p+1, r-(p+1)-1);
+ strncpy(tag, p+1, r-(p+1)-1);
tag[r-(p+1)-1] = '\0';
elemType = ELEM_OPENCLOSE;
}
else {
- mir_strncpy(tag, p+1, r-(p+1));
+ strncpy(tag, p+1, r-(p+1));
tag[r-(p+1)] = '\0';
elemType = ELEM_OPEN;
}
@@ -147,7 +147,7 @@ int TlenXmlParse(XmlState *xmlState, char *buffer, int datalen)
// TlenLog("ATTR_MAX_LEN too small, ignore current tag");
}
else {
- mir_strncpy(attr, r, q-r);
+ strncpy(attr, r, q-r);
if ((q-r)>0 && attr[q-r-1] == '/') {
attr[q-r-1] = '\0';
elemType = ELEM_OPENCLOSE;
@@ -171,7 +171,7 @@ int TlenXmlParse(XmlState *xmlState, char *buffer, int datalen)
for (q=p+1; q<eob && *q != '<'; q++);
if (q < eob) { // found starting bracket of the next element
str = (char *) mir_alloc(q-p+1);
- mir_strncpy(str, p, q-p);
+ strncpy(str, p, q-p);
str[q-p] = '\0';
TlenXmlProcessElem(xmlState, ELEM_TEXT, str, NULL);
mir_free(str);
@@ -220,7 +220,7 @@ static void TlenXmlParseAttr(XmlNode *node, char *text)
if (*p == '\0') {
a->name = (char *) mir_alloc(klen+1);
- mir_strncpy(a->name, kstart, klen);
+ strncpy(a->name, kstart, klen);
a->name[klen] = '\0';
a->value = mir_strdup("");
break;
@@ -228,7 +228,7 @@ static void TlenXmlParseAttr(XmlNode *node, char *text)
if (*p != '=') {
a->name = (char *) mir_alloc(klen+1);
- mir_strncpy(a->name, kstart, klen);
+ strncpy(a->name, kstart, klen);
a->name[klen] = '\0';
a->value = mir_strdup("");
continue;
@@ -242,7 +242,7 @@ static void TlenXmlParseAttr(XmlNode *node, char *text)
if (*p == '\0') {
a->name = (char *) mir_alloc(klen+1);
- mir_strncpy(a->name, kstart, klen);
+ strncpy(a->name, kstart, klen);
a->name[klen] = '\0';
a->value = mir_strdup("");
break;
@@ -263,10 +263,10 @@ static void TlenXmlParseAttr(XmlNode *node, char *text)
}
a->name = (char *) mir_alloc(klen+1);
- mir_strncpy(a->name, kstart, klen);
+ strncpy(a->name, kstart, klen);
a->name[klen] = '\0';
a->value = (char *) mir_alloc(vlen+1);
- mir_strncpy(a->value, vstart, vlen);
+ strncpy(a->value, vstart, vlen);
a->value[vlen] = '\0';
}
}