diff options
author | George Hazan <george.hazan@gmail.com> | 2015-05-23 18:55:59 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-05-23 18:55:59 +0000 |
commit | 2a815f8820ca402626bd283dd5b75744ddeb9812 (patch) | |
tree | b230e7ac7d0330f5a1a0c8891d0a7dda9c5b47c6 /protocols | |
parent | 9a177a4e355c52775b580ad5687db2120f9282d5 (diff) |
mir_tstrncpy <> _tcsncpy
git-svn-id: http://svn.miranda-ng.org/main/trunk@13791 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
55 files changed, 121 insertions, 121 deletions
diff --git a/protocols/AimOscar/src/services.cpp b/protocols/AimOscar/src/services.cpp index 25a6eb9012..01944ef024 100644 --- a/protocols/AimOscar/src/services.cpp +++ b/protocols/AimOscar/src/services.cpp @@ -413,7 +413,7 @@ INT_PTR CAimProto::GetAvatar(WPARAM wParam, LPARAM lParam) PROTO_AVATAR_INFORMATIONT ai = { sizeof(ai) };
if (GetAvatarInfo(0, (LPARAM)&ai) == GAIR_SUCCESS)
{
- mir_tstrncpy(buf, ai.filename, size);
+ _tcsncpy(buf, ai.filename, size);
buf[size-1] = 0;
return 0;
}
diff --git a/protocols/FacebookRM/src/avatars.cpp b/protocols/FacebookRM/src/avatars.cpp index 3a87ed85af..3f9dfa0994 100644 --- a/protocols/FacebookRM/src/avatars.cpp +++ b/protocols/FacebookRM/src/avatars.cpp @@ -223,7 +223,7 @@ INT_PTR FacebookProto::GetMyAvatar(WPARAM wParam, LPARAM lParam) PROTO_AVATAR_INFORMATIONT ai = { sizeof(ai) };
switch (GetAvatarInfo(0, (LPARAM)&ai)) {
case GAIR_SUCCESS:
- mir_tstrncpy(buf, ai.filename, size);
+ _tcsncpy(buf, ai.filename, size);
buf[size - 1] = 0;
return 0;
diff --git a/protocols/GTalkExt/src/handlers.cpp b/protocols/GTalkExt/src/handlers.cpp index 8f4c54600b..16af0a823e 100644 --- a/protocols/GTalkExt/src/handlers.cpp +++ b/protocols/GTalkExt/src/handlers.cpp @@ -67,7 +67,7 @@ LPTSTR ExtractJid(LPCTSTR jidWithRes) size_t l = size_t(p - jidWithRes);
LPTSTR result = (LPTSTR)mir_alloc((l + 1) * sizeof(TCHAR));
- mir_tstrncpy(result, jidWithRes, l);
+ _tcsncpy(result, jidWithRes, l);
result[l] = 0;
return result;
}
diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp index 6d4bfcb17d..2bf2907cf4 100644 --- a/protocols/Gadu-Gadu/src/core.cpp +++ b/protocols/Gadu-Gadu/src/core.cpp @@ -207,7 +207,7 @@ int gg_decodehosts(char *var, GGHOST *hosts, int max) // Insert new item
hosts[hp].hostname[127] = 0;
- mir_strncpy(hosts[hp].hostname, hostname, 127);
+ strncpy(hosts[hp].hostname, hostname, 127);
hosts[hp].port = portname ? atoi(portname) : 443;
hp ++;
diff --git a/protocols/Gadu-Gadu/src/dynstuff.cpp b/protocols/Gadu-Gadu/src/dynstuff.cpp index e84273f6a3..4d21ed7eb0 100644 --- a/protocols/Gadu-Gadu/src/dynstuff.cpp +++ b/protocols/Gadu-Gadu/src/dynstuff.cpp @@ -247,7 +247,7 @@ int string_append_n(string_t s, const char *str, int count) string_realloc(s, s->len + count);
s->str[s->len + count] = 0;
- mir_strncpy(s->str + s->len, str, count);
+ strncpy(s->str + s->len, str, count);
s->len += count;
@@ -480,7 +480,7 @@ char **array_make(const char *string, const char *sep, int max, int trim, int qu } else {
for (q = p, len = 0; *q && (last || !strchr(sep, *q)); q++, len++);
token = (char*)calloc(1, len + 1);
- mir_strncpy(token, p, len);
+ strncpy(token, p, len);
token[len] = 0;
p = q;
}
diff --git a/protocols/Gadu-Gadu/src/filetransfer.cpp b/protocols/Gadu-Gadu/src/filetransfer.cpp index bfa4e99c50..3d23d0a9a5 100644 --- a/protocols/Gadu-Gadu/src/filetransfer.cpp +++ b/protocols/Gadu-Gadu/src/filetransfer.cpp @@ -269,7 +269,7 @@ void __cdecl GGPROTO::dccmainthread(void*) {
PROTOFILETRANSFERSTATUS pfts;
local_dcc->tick = tick;
- mir_strncpy(filename, local_dcc->folder, sizeof(filename));
+ strncpy(filename, local_dcc->folder, sizeof(filename));
mir_strncat(filename, (char*)local_dcc->file_info.filename, sizeof(filename) - mir_strlen(filename));
memset(&pfts, 0, sizeof(PROTOFILETRANSFERSTATUS));
pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS);
@@ -300,7 +300,7 @@ void __cdecl GGPROTO::dccmainthread(void*) if (local_dcc->file_fd != -1)
{
PROTOFILETRANSFERSTATUS pfts;
- mir_strncpy(filename, local_dcc->folder, sizeof(filename));
+ strncpy(filename, local_dcc->folder, sizeof(filename));
mir_strncat(filename, (char*)local_dcc->file_info.filename, sizeof(filename) - mir_strlen(filename));
memset(&pfts, 0, sizeof(PROTOFILETRANSFERSTATUS));
pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS);
@@ -499,7 +499,7 @@ void __cdecl GGPROTO::dccmainthread(void*) {
PROTOFILETRANSFERSTATUS pfts;
local_dcc7->tick = tick;
- mir_strncpy(filename, local_dcc7->folder, sizeof(filename));
+ strncpy(filename, local_dcc7->folder, sizeof(filename));
mir_strncat(filename, (char*)local_dcc7->filename, sizeof(filename) - mir_strlen(filename));
memset(&pfts, 0, sizeof(PROTOFILETRANSFERSTATUS));
pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS);
@@ -530,7 +530,7 @@ void __cdecl GGPROTO::dccmainthread(void*) if (local_dcc7->file_fd != -1)
{
PROTOFILETRANSFERSTATUS pfts;
- mir_strncpy(filename, local_dcc7->folder, sizeof(filename));
+ strncpy(filename, local_dcc7->folder, sizeof(filename));
mir_strncat(filename, (char*)local_dcc7->filename, sizeof(filename) - mir_strlen(filename));
memset(&pfts, 0, sizeof(PROTOFILETRANSFERSTATUS));
pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS);
@@ -666,7 +666,7 @@ HANDLE GGPROTO::dccfileallow(HANDLE hTransfer, const PROTOCHAR* szPath) {
struct gg_dcc *dcc = (struct gg_dcc *) hTransfer;
char fileName[MAX_PATH], *path = mir_t2a(szPath);
- mir_strncpy(fileName, path, sizeof(fileName));
+ strncpy(fileName, path, sizeof(fileName));
mir_strncat(fileName, (char*)dcc->file_info.filename, sizeof(fileName) - mir_strlen(fileName));
dcc->folder = _strdup((char *) path);
dcc->tick = 0;
@@ -708,7 +708,7 @@ HANDLE GGPROTO::dcc7fileallow(HANDLE hTransfer, const PROTOCHAR* szPath) struct gg_dcc7 *dcc7 = (struct gg_dcc7 *) hTransfer;
char fileName[MAX_PATH], *path = mir_t2a(szPath);
int iFtRemoveRes;
- mir_strncpy(fileName, path, sizeof(fileName));
+ strncpy(fileName, path, sizeof(fileName));
mir_strncat(fileName, (char*)dcc7->filename, sizeof(fileName) - mir_strlen(fileName));
dcc7->folder = _strdup((char *) path);
dcc7->tick = 0;
diff --git a/protocols/Gadu-Gadu/src/gg.cpp b/protocols/Gadu-Gadu/src/gg.cpp index 7196ed4b3c..45fd51745f 100644 --- a/protocols/Gadu-Gadu/src/gg.cpp +++ b/protocols/Gadu-Gadu/src/gg.cpp @@ -436,7 +436,7 @@ void gg_debughandler(int level, const char *format, va_list ap) char *nl = strrchr(szFormat, '\n');
if (nl) *nl = 0;
- mir_strncpy(szText + PREFIXLEN, "[libgadu] \0", sizeof(szText) - PREFIXLEN);
+ strncpy(szText + PREFIXLEN, "[libgadu] \0", sizeof(szText) - PREFIXLEN);
char prefix[6];
mir_snprintf(prefix, SIZEOF(prefix), "%lu", GetCurrentThreadId());
diff --git a/protocols/Gadu-Gadu/src/image.cpp b/protocols/Gadu-Gadu/src/image.cpp index 56528ba82b..7fccf30251 100644 --- a/protocols/Gadu-Gadu/src/image.cpp +++ b/protocols/Gadu-Gadu/src/image.cpp @@ -226,10 +226,10 @@ TCHAR *gg_img_getfilter(TCHAR *szFilter, int nSize) szFilterMask = _T("*.bmp;*.gif;*.jpeg;*.jpg;*.png");
// Make up filter
- mir_tstrncpy(pFilter, szFilterName, nSize);
+ _tcsncpy(pFilter, szFilterName, nSize);
pFilter += mir_tstrlen(pFilter) + 1;
if (pFilter >= szFilter + nSize) return NULL;
- mir_tstrncpy(pFilter, szFilterMask, nSize - (pFilter - szFilter));
+ _tcsncpy(pFilter, szFilterMask, nSize - (pFilter - szFilter));
pFilter += mir_tstrlen(pFilter) + 1;
if (pFilter >= szFilter + nSize) return NULL;
*pFilter = 0;
@@ -251,7 +251,7 @@ int gg_img_saveimage(HWND hwnd, GGIMAGEENTRY *dat) gg_img_getfilter(szFilter, SIZEOF(szFilter));
TCHAR szFileName[MAX_PATH];
- mir_tstrncpy(szFileName, dat->lpszFileName, SIZEOF(szFileName));
+ _tcsncpy(szFileName, dat->lpszFileName, SIZEOF(szFileName));
OPENFILENAME ofn = {0};
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
diff --git a/protocols/Gadu-Gadu/src/import.cpp b/protocols/Gadu-Gadu/src/import.cpp index 42ee730f8e..2ca709ae01 100644 --- a/protocols/Gadu-Gadu/src/import.cpp +++ b/protocols/Gadu-Gadu/src/import.cpp @@ -119,7 +119,7 @@ char *strndup(char *str, int c) {
char *ret = (char*)malloc(c + 1);
ret[c] = 0;
- mir_strncpy(ret, str, c);
+ strncpy(ret, str, c);
return ret;
}
@@ -174,7 +174,7 @@ void GGPROTO::parsecontacts(char *contacts) if (n && n != p)
{
strPhone = (char*)malloc((n - p) + 5);
- mir_strncpy(strPhone, p, (n - p));
+ strncpy(strPhone, p, (n - p));
mir_strcpy((strPhone + (n - p)), " SMS"); // Add SMS postfix
}
p = (n + 1);
@@ -336,24 +336,24 @@ INT_PTR GGPROTO::import_text(WPARAM wParam, LPARAM lParam) OPENFILENAME ofn = {0};
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
- mir_tstrncpy(filter, TranslateT("Text files"), SIZEOF(filter));
+ _tcsncpy(filter, TranslateT("Text files"), SIZEOF(filter));
mir_tstrncat(filter, _T(" (*.txt)"), SIZEOF(filter) - mir_tstrlen(filter));
pfilter = filter + mir_tstrlen(filter) + 1;
if (pfilter >= filter + SIZEOF(filter))
return 0;
- mir_tstrncpy(pfilter, _T("*.TXT"), SIZEOF(filter) - (pfilter - filter));
+ _tcsncpy(pfilter, _T("*.TXT"), SIZEOF(filter) - (pfilter - filter));
pfilter = pfilter + mir_tstrlen(pfilter) + 1;
if (pfilter >= filter + SIZEOF(filter))
return 0;
- mir_tstrncpy(pfilter, TranslateT("All Files"), SIZEOF(filter) - (pfilter - filter));
+ _tcsncpy(pfilter, TranslateT("All Files"), SIZEOF(filter) - (pfilter - filter));
mir_tstrncat(pfilter, _T(" (*)"), SIZEOF(filter) - (pfilter - filter) - mir_tstrlen(pfilter));
pfilter = pfilter + mir_tstrlen(pfilter) + 1;
if (pfilter >= filter + SIZEOF(filter))
return 0;
- mir_tstrncpy(pfilter, _T("*"), SIZEOF(filter) - (pfilter - filter));
+ _tcsncpy(pfilter, _T("*"), SIZEOF(filter) - (pfilter - filter));
pfilter = pfilter + mir_tstrlen(pfilter) + 1;
if (pfilter >= filter + SIZEOF(filter))
return 0;
@@ -403,25 +403,25 @@ INT_PTR GGPROTO::export_text(WPARAM wParam, LPARAM lParam) OPENFILENAME ofn = {0};
TCHAR filter[512], *pfilter;
- mir_tstrncpy(str, TranslateT("contacts"), SIZEOF(str));
+ _tcsncpy(str, TranslateT("contacts"), SIZEOF(str));
mir_tstrncat(str, _T(".txt"), SIZEOF(str) - mir_tstrlen(str));
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
- mir_tstrncpy(filter, TranslateT("Text files"), SIZEOF(filter));
+ _tcsncpy(filter, TranslateT("Text files"), SIZEOF(filter));
mir_tstrncat(filter, _T(" (*.txt)"), SIZEOF(filter) - mir_tstrlen(filter));
pfilter = filter + mir_tstrlen(filter) + 1;
if (pfilter >= filter + SIZEOF(filter))
return 0;
- mir_tstrncpy(pfilter, _T("*.TXT"), SIZEOF(filter) - (pfilter - filter));
+ _tcsncpy(pfilter, _T("*.TXT"), SIZEOF(filter) - (pfilter - filter));
pfilter = pfilter + mir_tstrlen(pfilter) + 1;
if (pfilter >= filter + SIZEOF(filter))
return 0;
- mir_tstrncpy(pfilter, TranslateT("All Files"), SIZEOF(filter) - (pfilter - filter));
+ _tcsncpy(pfilter, TranslateT("All Files"), SIZEOF(filter) - (pfilter - filter));
mir_tstrncat(pfilter, _T(" (*)"), SIZEOF(filter) - (pfilter - filter) - mir_tstrlen(pfilter));
pfilter = pfilter + mir_tstrlen(pfilter) + 1;
if (pfilter >= filter + SIZEOF(filter))
return 0;
- mir_tstrncpy(pfilter, _T("*"), SIZEOF(filter) - (pfilter - filter));
+ _tcsncpy(pfilter, _T("*"), SIZEOF(filter) - (pfilter - filter));
pfilter = pfilter + mir_tstrlen(pfilter) + 1;
if (pfilter >= filter + SIZEOF(filter))
return 0;
diff --git a/protocols/Gadu-Gadu/src/services.cpp b/protocols/Gadu-Gadu/src/services.cpp index 09b79b9b44..d0f442d872 100644 --- a/protocols/Gadu-Gadu/src/services.cpp +++ b/protocols/Gadu-Gadu/src/services.cpp @@ -42,7 +42,7 @@ char *gg_status2db(int status, const char *suffix) case ID_STATUS_OUTTOLUNCH: prefix = "Otl"; break;
default: return NULL;
}
- mir_strncpy(str, prefix, sizeof(str));
+ strncpy(str, prefix, sizeof(str));
mir_strncat(str, suffix, sizeof(str) - mir_strlen(str));
return str;
}
diff --git a/protocols/Gadu-Gadu/src/token.cpp b/protocols/Gadu-Gadu/src/token.cpp index 85df02f089..2fcf36d31d 100644 --- a/protocols/Gadu-Gadu/src/token.cpp +++ b/protocols/Gadu-Gadu/src/token.cpp @@ -132,7 +132,7 @@ int GGPROTO::gettoken(GGTOKEN *token) }
// Return token id
- mir_strncpy(dat.id, t->tokenid, sizeof(dat.id));
+ strncpy(dat.id, t->tokenid, sizeof(dat.id));
dat.width = t->width;
dat.height = t->height;
@@ -154,8 +154,8 @@ int GGPROTO::gettoken(GGTOKEN *token) return FALSE;
// Fillup patterns
- mir_strncpy(token->id, dat.id, sizeof(token->id));
- mir_strncpy(token->val, dat.val, sizeof(token->val));
+ strncpy(token->id, dat.id, sizeof(token->id));
+ strncpy(token->val, dat.val, sizeof(token->val));
return TRUE;
}
diff --git a/protocols/Gadu-Gadu/src/userutils.cpp b/protocols/Gadu-Gadu/src/userutils.cpp index 1dd223b08a..a5fcae5ee3 100644 --- a/protocols/Gadu-Gadu/src/userutils.cpp +++ b/protocols/Gadu-Gadu/src/userutils.cpp @@ -126,7 +126,7 @@ void *gg_dochpass(GGPROTO *gg, uin_t uin, char *password, char *newPass) if (!gg->getString(GG_KEY_EMAIL, &dbv_email))
{
- mir_strncpy(email, dbv_email.pszVal, sizeof(email));
+ strncpy(email, dbv_email.pszVal, sizeof(email));
db_free(&dbv_email);
}
diff --git a/protocols/ICQCorp/src/services.cpp b/protocols/ICQCorp/src/services.cpp index 48bc68d16e..d4c8379d75 100644 --- a/protocols/ICQCorp/src/services.cpp +++ b/protocols/ICQCorp/src/services.cpp @@ -47,7 +47,7 @@ static INT_PTR icqGetCaps(WPARAM wParam, LPARAM lParam) static INT_PTR icqGetName(WPARAM wParam, LPARAM lParam)
{
- mir_strncpy((char*)lParam, Translate(protoName), wParam);
+ strncpy((char*)lParam, Translate(protoName), wParam);
return 0;
}
diff --git a/protocols/IRCG/src/options.cpp b/protocols/IRCG/src/options.cpp index 29212e110d..24f51da361 100644 --- a/protocols/IRCG/src/options.cpp +++ b/protocols/IRCG/src/options.cpp @@ -1218,7 +1218,7 @@ CAddIgnoreDlg::CAddIgnoreDlg(CIrcProto* _pro, const TCHAR* mask, CIgnorePrefsDlg if (mask == NULL)
szOldMask[0] = 0;
else
- mir_tstrncpy(szOldMask, mask, SIZEOF(szOldMask));
+ _tcsncpy(szOldMask, mask, SIZEOF(szOldMask));
m_Ok.OnClick = Callback(this, &CAddIgnoreDlg::OnOk);
}
diff --git a/protocols/IcqOscarJ/src/icqosc_svcs.cpp b/protocols/IcqOscarJ/src/icqosc_svcs.cpp index 89df241c17..ff7c0d5f1f 100644 --- a/protocols/IcqOscarJ/src/icqosc_svcs.cpp +++ b/protocols/IcqOscarJ/src/icqosc_svcs.cpp @@ -391,7 +391,7 @@ INT_PTR CIcqProto::GetMyAvatar(WPARAM wParam, LPARAM lParam) TCHAR *tszFile = GetOwnAvatarFileName();
if (tszFile && !_taccess(tszFile, 0)) {
- mir_tstrncpy((TCHAR*)wParam, tszFile, (int)lParam);
+ _tcsncpy((TCHAR*)wParam, tszFile, (int)lParam);
SAFE_FREE(&tszFile);
return 0;
}
diff --git a/protocols/IcqOscarJ/src/utilities.cpp b/protocols/IcqOscarJ/src/utilities.cpp index a94f366290..3a5974df1a 100644 --- a/protocols/IcqOscarJ/src/utilities.cpp +++ b/protocols/IcqOscarJ/src/utilities.cpp @@ -612,7 +612,7 @@ char* __fastcall null_strcpy(char *dest, const char *src, size_t maxlen) return NULL;
if (src && src[0]) {
- mir_strncpy(dest, src, maxlen);
+ strncpy(dest, src, maxlen);
dest[maxlen] = '\0';
}
else
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp index 6aeab1a831..79335a9182 100644 --- a/protocols/JabberG/src/jabber_menu.cpp +++ b/protocols/JabberG/src/jabber_menu.cpp @@ -602,7 +602,7 @@ INT_PTR __cdecl CJabberProto::OnMenuBookmarkAdd(WPARAM hContact, LPARAM) void CJabberProto::MenuInit()
{
char text[200];
- mir_strncpy(text, m_szModuleName, sizeof(text)-1);
+ strncpy(text, m_szModuleName, sizeof(text)-1);
char* tDest = text + mir_strlen(text);
CLISTMENUITEM mi = { sizeof(mi) };
@@ -825,7 +825,7 @@ void CJabberProto::GlobalMenuInit() // Hotkeys
char text[200];
- mir_strncpy(text, m_szModuleName, sizeof(text) - 1);
+ strncpy(text, m_szModuleName, sizeof(text) - 1);
char* tDest = text + mir_strlen(text);
HOTKEYDESC hkd = { sizeof(hkd) };
diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp index 483f1f488f..d2f84ff04f 100644 --- a/protocols/MRA/src/Mra_functions.cpp +++ b/protocols/MRA/src/Mra_functions.cpp @@ -669,7 +669,7 @@ void CMraProto::MraUpdateEmailStatus(const CMStringA &pszFrom, const CMStringA & cle.ptszTooltip = szStatusText;
if (getByte("TrayIconNewMailClkToInbox", MRA_DEFAULT_TRAYICON_NEW_MAIL_CLK_TO_INBOX)) {
- mir_strncpy(szServiceFunction, m_szModuleName, MAX_PATH);
+ strncpy(szServiceFunction, m_szModuleName, MAX_PATH);
pszServiceFunctionName = szServiceFunction + mir_strlen(m_szModuleName);
memcpy(pszServiceFunctionName, MRA_GOTO_INBOX, sizeof(MRA_GOTO_INBOX));
cle.pszService = szServiceFunction;
diff --git a/protocols/MRA/src/Mra_menus.cpp b/protocols/MRA/src/Mra_menus.cpp index f4c6136ca4..6f349e9d0d 100644 --- a/protocols/MRA/src/Mra_menus.cpp +++ b/protocols/MRA/src/Mra_menus.cpp @@ -278,7 +278,7 @@ int CMraProto::MraRebuildContactMenu(WPARAM hContact, LPARAM) int CMraProto::MraRebuildStatusMenu(WPARAM, LPARAM)
{
CHAR szServiceFunction[MAX_PATH * 2], *pszServiceFunctionName, szValueName[MAX_PATH];
- mir_strncpy(szServiceFunction, m_szModuleName, sizeof(szServiceFunction));
+ strncpy(szServiceFunction, m_szModuleName, sizeof(szServiceFunction));
pszServiceFunctionName = szServiceFunction + mir_strlen(m_szModuleName);
TCHAR szItem[MAX_PATH + 64];
@@ -326,7 +326,7 @@ HGENMENU CMraProto::CListCreateMenu(LONG lPosition, LONG lPopupPosition, BOOL bI return NULL;
char szServiceFunction[MAX_PATH];
- mir_strncpy(szServiceFunction, m_szModuleName, sizeof(szServiceFunction));
+ strncpy(szServiceFunction, m_szModuleName, sizeof(szServiceFunction));
char *pszServiceFunctionName = szServiceFunction + mir_strlen(m_szModuleName);
CLISTMENUITEM mi = { sizeof(mi) };
diff --git a/protocols/MSN/src/msn_chat.cpp b/protocols/MSN/src/msn_chat.cpp index 8f3e6e0ba6..4e9b439eb7 100644 --- a/protocols/MSN/src/msn_chat.cpp +++ b/protocols/MSN/src/msn_chat.cpp @@ -47,14 +47,14 @@ int CMsnProto::MSN_ChatInit(GCThreadData *info, const char *pszID, const char *p {
char *szNet, *szEmail;
- mir_tstrncpy(info->mChatID, _A2T(pszID), SIZEOF(info->mChatID));
+ _tcsncpy(info->mChatID, _A2T(pszID), SIZEOF(info->mChatID));
parseWLID(NEWSTR_ALLOCA(pszID), &szNet, &szEmail, NULL);
info->netId = atoi(szNet);
- mir_strncpy(info->szEmail, szEmail, sizeof(info->szEmail));
+ strncpy(info->szEmail, szEmail, sizeof(info->szEmail));
TCHAR szName[512];
InterlockedIncrement(&m_chatID);
- if (*pszTopic) mir_tstrncpy(szName, _A2T(pszTopic), SIZEOF(szName));
+ if (*pszTopic) _tcsncpy(szName, _A2T(pszTopic), SIZEOF(szName));
else mir_sntprintf(szName, SIZEOF(szName), _T("%s %s%d"),
m_tszUserName, TranslateT("Chat #"), m_chatID);
@@ -123,7 +123,7 @@ void CMsnProto::MSN_ChatStart(ezxml_t xmli) if (!gcu) {
gcu = new GCUserItem;
info->mJoinedContacts.insert(gcu);
- mir_strncpy(gcu->WLID, mri, sizeof(gcu->WLID));
+ strncpy(gcu->WLID, mri, sizeof(gcu->WLID));
}
mir_tstrcpy(gcu->role, _A2T(role));
diff --git a/protocols/MSN/src/msn_libstr.cpp b/protocols/MSN/src/msn_libstr.cpp index bf45995a0f..78e9c66584 100644 --- a/protocols/MSN/src/msn_libstr.cpp +++ b/protocols/MSN/src/msn_libstr.cpp @@ -411,6 +411,6 @@ time_t MsnTSToUnixtime(const char *pszTS) char szTS[16];
if (!*pszTS) return time(NULL);
- mir_strncpy(szTS, pszTS, 10);
+ strncpy(szTS, pszTS, 10);
return (time_t)atoi(szTS);
}
diff --git a/protocols/MSN/src/msn_p2p.cpp b/protocols/MSN/src/msn_p2p.cpp index 6a50f7dcd4..fbaa187a5c 100644 --- a/protocols/MSN/src/msn_p2p.cpp +++ b/protocols/MSN/src/msn_p2p.cpp @@ -100,7 +100,7 @@ bool CMsnProto::p2p_createListener(filetransfer* ft, directconnection *dc, MimeH newThread->mCaller = 3;
newThread->mIncomingBoundPort = sb;
newThread->mIncomingPort = nlb.wPort;
- mir_strncpy(newThread->mCookie, dc->callId, sizeof(newThread->mCookie));
+ strncpy(newThread->mCookie, dc->callId, sizeof(newThread->mCookie));
newThread->mInitialContactWLID = mir_strdup(ft->p2p_dest);
newThread->startThread(&CMsnProto::p2p_filePassiveThread, this);
diff --git a/protocols/Sametime/src/options.cpp b/protocols/Sametime/src/options.cpp index b1a15f850a..f9a2ee775f 100644 --- a/protocols/Sametime/src/options.cpp +++ b/protocols/Sametime/src/options.cpp @@ -363,15 +363,15 @@ void CSametimeProto::LoadOptions() DBVARIANT dbv;
if (!db_get_utf(0, m_szModuleName, "ServerName", &dbv)) {
- mir_strncpy(options.server_name, dbv.pszVal, LSTRINGLEN);
+ strncpy(options.server_name, dbv.pszVal, LSTRINGLEN);
db_free(&dbv);
}
if (!db_get_utf(0, m_szModuleName, "stid", &dbv)) {
- mir_strncpy(options.id, dbv.pszVal, LSTRINGLEN);
+ strncpy(options.id, dbv.pszVal, LSTRINGLEN);
db_free(&dbv);
}
if (!db_get_utf(0, m_szModuleName, "Password", &dbv)) {
- mir_strncpy(options.pword, dbv.pszVal, LSTRINGLEN);
+ strncpy(options.pword, dbv.pszVal, LSTRINGLEN);
db_free(&dbv);
}
diff --git a/protocols/Sametime/src/sametime.cpp b/protocols/Sametime/src/sametime.cpp index 627b9a7d56..708be8481f 100644 --- a/protocols/Sametime/src/sametime.cpp +++ b/protocols/Sametime/src/sametime.cpp @@ -44,7 +44,7 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_PROTOCO */
INT_PTR CSametimeProto::GetName(WPARAM wParam, LPARAM lParam)
{
- mir_strncpy((char*)lParam, m_szModuleName, wParam);
+ strncpy((char*)lParam, m_szModuleName, wParam);
return 0;
}
diff --git a/protocols/Sametime/src/userlist.cpp b/protocols/Sametime/src/userlist.cpp index aeb7b69156..debe054ec3 100644 --- a/protocols/Sametime/src/userlist.cpp +++ b/protocols/Sametime/src/userlist.cpp @@ -673,10 +673,10 @@ void mwResolve_handler_callback(mwServiceResolve* srvc, guint32 id, guint32 code if (advanced == TRUE) {
// send column names
mcsr.psr.cbSize = 0;
- mir_tstrncpy(mcsr.pszFields[0], TranslateT("ID"), 512);
- mir_tstrncpy(mcsr.pszFields[1], TranslateT("Name"), 512);
- mir_tstrncpy(mcsr.pszFields[2], TranslateT("Description"), 512);
- mir_tstrncpy(mcsr.pszFields[3], TranslateT("Group?"), 512);
+ _tcsncpy(mcsr.pszFields[0], TranslateT("ID"), 512);
+ _tcsncpy(mcsr.pszFields[1], TranslateT("Name"), 512);
+ _tcsncpy(mcsr.pszFields[2], TranslateT("Description"), 512);
+ _tcsncpy(mcsr.pszFields[3], TranslateT("Group?"), 512);
proto->ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SEARCHRESULT, (HANDLE)id, (LPARAM)&mcsr);
}
@@ -687,11 +687,11 @@ void mwResolve_handler_callback(mwServiceResolve* srvc, guint32 id, guint32 code for (; ri; ri = ri->next) {
mri = ((mwResolveResult *)ri->data)->matches;
for (; mri; mri = mri->next) {
- mir_strncpy(mcsr.psr.stid, ((mwResolveMatch *)mri->data)->id, 256);
+ strncpy(mcsr.psr.stid, ((mwResolveMatch *)mri->data)->id, 256);
mcsr.psr.stid[255] = 0;
MultiByteToWideChar(CP_UTF8, 0, mcsr.psr.stid, -1, mcsr.pszFields[0], 512);
- mir_strncpy(mcsr.psr.name, ((mwResolveMatch *)mri->data)->name, 256);
+ strncpy(mcsr.psr.name, ((mwResolveMatch *)mri->data)->name, 256);
mcsr.psr.name[255] = 0;
MultiByteToWideChar(CP_UTF8, 0, mcsr.psr.name, -1, mcsr.pszFields[1], 512);
@@ -702,7 +702,7 @@ void mwResolve_handler_callback(mwServiceResolve* srvc, guint32 id, guint32 code mcsr.psr.group = (((mwResolveMatch *)mri->data)->type == mwResolveMatch_GROUP);
//MultiByteToWideChar(CP_UTF8, 0, mcsr.psr.name, -1, mcsr.pszFields[1], 512);
- mir_tstrncpy(mcsr.pszFields[3], mcsr.psr.group ? TranslateT("True") : TranslateT("False"), 512);
+ _tcsncpy(mcsr.pszFields[3], mcsr.psr.group ? TranslateT("True") : TranslateT("False"), 512);
if (advanced == TRUE)
proto->ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SEARCHRESULT, (HANDLE)id, (LPARAM)&mcsr);
diff --git a/protocols/SkypeClassic/src/filexfer.cpp b/protocols/SkypeClassic/src/filexfer.cpp index 5a8ff3df76..313af9a315 100644 --- a/protocols/SkypeClassic/src/filexfer.cpp +++ b/protocols/SkypeClassic/src/filexfer.cpp @@ -366,7 +366,7 @@ BOOL FXHandleMessage(const char *pszMsg) if (!pTok)
return FALSE;
- mir_strncpy(args.szNum, pszMsg, pTok - pszMsg);
+ strncpy(args.szNum, pszMsg, pTok - pszMsg);
pszMsg = pTok + 1;
if (!(pTok = strchr(pszMsg, ' '))) return FALSE;
pTok++;
@@ -374,7 +374,7 @@ BOOL FXHandleMessage(const char *pszMsg) return FALSE;
ft_args *pargs = (ft_args*)malloc(sizeof(args));
if (!pargs) return TRUE;
- mir_strncpy(args.szArg, pTok, sizeof(args.szArg));
+ strncpy(args.szArg, pTok, sizeof(args.szArg));
memcpy(pargs, &args, sizeof(args));
pthread_create((pThreadFunc)FXHandleMessageThread, pargs);
return TRUE;
diff --git a/protocols/SkypeClassic/src/skype.cpp b/protocols/SkypeClassic/src/skype.cpp index 14a4363533..147b467ecc 100644 --- a/protocols/SkypeClassic/src/skype.cpp +++ b/protocols/SkypeClassic/src/skype.cpp @@ -1387,7 +1387,7 @@ void MessageListProcessingThread(char *str) { // Frst we need to sort the message timestamps
for ((token = strtok_r(str+1, ", ", &nextoken)); token; token = strtok_r(NULL, ", ", &nextoken)) {
if (args = (fetchmsg_arg*)calloc(1, sizeof(fetchmsg_arg) + sizeof(DWORD))) {
- mir_strncpy(args->msgnum, token, sizeof(args->msgnum)-1);
+ strncpy(args->msgnum, token, sizeof(args->msgnum)-1);
args->getstatus = TRUE;
args->bIsRead = *str;
args->bDontMarkSeen = *str;
@@ -2163,7 +2163,7 @@ LRESULT APIENTRY WndProc(HWND hWndDlg, UINT message, UINT wParam, LONG lParam) // If new message is available, fetch it
ptr[0] = 0;
if (!(args = (fetchmsg_arg *)calloc(1, sizeof(*args)))) break;
- mir_strncpy(args->msgnum, pMsgNum, sizeof(args->msgnum)-1);
+ strncpy(args->msgnum, pMsgNum, sizeof(args->msgnum)-1);
args->getstatus = FALSE;
//args->bIsRead = strncmp(ptr+8, "READ", 4) == 0;
pthread_create((pThreadFunc)FetchMessageThreadSync, args);
@@ -2467,7 +2467,7 @@ void RetrieveUserAvatar(void *param) // Got it
MoveFileExA(pszTempFile, AvatarFile, MOVEFILE_REPLACE_EXISTING);
AI.format = PA_FORMAT_JPEG;
- mir_strncpy(AI.filename, AvatarFile,SIZEOF(AI.filename)-1);
+ strncpy(AI.filename, AvatarFile,SIZEOF(AI.filename)-1);
ack.hProcess = (HANDLE)&AI;
}
diff --git a/protocols/SkypeClassic/src/skypeapi.cpp b/protocols/SkypeClassic/src/skypeapi.cpp index e86658e69f..ad6bc71967 100644 --- a/protocols/SkypeClassic/src/skypeapi.cpp +++ b/protocols/SkypeClassic/src/skypeapi.cpp @@ -518,7 +518,7 @@ char *SkypeRcvMsg(char *what, time_t st, MCONTACT hContact, DWORD maxwait) // isn't using the ID anymore, so we have to save the ID as new identifier for message recognition
pCurMsg+=iLenWhat;
if ((pMsg = strchr (pCurMsg, ' ')) && (pMsg=strchr (pMsg+1, ' ')))
- mir_strncpy (msgid, pCurMsg, pMsg-pCurMsg);
+ strncpy (msgid, pCurMsg, pMsg-pCurMsg);
else if (strncmp (pCurMsg, "ERROR", 5) == 0) bIsError = TRUE;
}
@@ -1171,7 +1171,7 @@ INT_PTR SkypeSetAvatar(WPARAM wParam, LPARAM lParam) { // Backup old file
if (hasOldAvatar)
{
- mir_strncpy(OldAvatarFile, dbv.pszVal, sizeof(OldAvatarFile)-4);
+ strncpy(OldAvatarFile, dbv.pszVal, sizeof(OldAvatarFile)-4);
OldAvatarFile[sizeof(OldAvatarFile)-5] = '\0';
mir_strcat(OldAvatarFile, "_old");
DeleteFileA(OldAvatarFile);
diff --git a/protocols/SkypeClassic/src/skypeopt.cpp b/protocols/SkypeClassic/src/skypeopt.cpp index fb35c5f483..358a95e153 100644 --- a/protocols/SkypeClassic/src/skypeopt.cpp +++ b/protocols/SkypeClassic/src/skypeopt.cpp @@ -611,12 +611,12 @@ INT_PTR CALLBACK OptionsDefaultDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L db_set_b (NULL, SKYPE_PROTONAME, "secondary", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_SECONDARY)));
GetDlgItemTextA(hwndDlg,IDC_COMMANDLINE,text,SIZEOF(text));
- mir_strncpy(szRelativePath, text, sizeof(szRelativePath)-1);
+ strncpy(szRelativePath, text, sizeof(szRelativePath)-1);
CallService (MS_UTILS_PATHTORELATIVE, (WPARAM)text, (LPARAM)szRelativePath);
db_set_s(NULL, SKYPE_PROTONAME, "CommandLine", szRelativePath);
GetDlgItemTextA(hwndDlg,IDC_DATAPATH,text,SIZEOF(text));
- mir_strncpy(szRelativePath, text, sizeof(szRelativePath)-1);
+ strncpy(szRelativePath, text, sizeof(szRelativePath)-1);
CallService (MS_UTILS_PATHTORELATIVE, (WPARAM)text, (LPARAM)szRelativePath);
db_set_s(NULL, SKYPE_PROTONAME, "datapath", szRelativePath);
diff --git a/protocols/SkypeClassic/src/skypeprofile.cpp b/protocols/SkypeClassic/src/skypeprofile.cpp index b796a96667..045a5b7d78 100644 --- a/protocols/SkypeClassic/src/skypeprofile.cpp +++ b/protocols/SkypeClassic/src/skypeprofile.cpp @@ -105,7 +105,7 @@ static void LoadSaveSkype(SkypeProfile *pstProf, BOOL bSet) if (astSettings[i].cType == sizeof(char)) {
char *pBuf;
if (utf8_decode (ptr, &pBuf) != -1) {
- mir_strncpy ((char*)astSettings[i].lpDest, pBuf, astSettings[i].iSize);
+ strncpy ((char*)astSettings[i].lpDest, pBuf, astSettings[i].iSize);
free (pBuf);
}
} else {
diff --git a/protocols/SkypeClassic/src/skypeproxy/skypeproxy.c b/protocols/SkypeClassic/src/skypeproxy/skypeproxy.c index 0802788e10..200b79632a 100644 --- a/protocols/SkypeClassic/src/skypeproxy/skypeproxy.c +++ b/protocols/SkypeClassic/src/skypeproxy/skypeproxy.c @@ -520,7 +520,7 @@ int main(int argc, char *argv[]) { }
for (i=0;i<argc;i++) {
if (!mir_strcmpi(argv[i], "-i") && argc>i+1)
- mir_strncpy(BindIP, argv[i+1], sizeof(BindIP));
+ strncpy(BindIP, argv[i+1], sizeof(BindIP));
if (!mir_strcmpi(argv[i], "-p") && argc>i+1)
if (!(BindPort=atoi(argv[i+1]))) {
OUTPUT("ERROR: Cannot convert port to int. bye..");
diff --git a/protocols/SkypeClassic/src/skypesvc.cpp b/protocols/SkypeClassic/src/skypesvc.cpp index e893721e42..fae8b8cd3b 100644 --- a/protocols/SkypeClassic/src/skypesvc.cpp +++ b/protocols/SkypeClassic/src/skypesvc.cpp @@ -147,7 +147,7 @@ INT_PTR SkypeGetName(WPARAM wParam, LPARAM lParam) {
if (lParam)
{
- mir_strncpy((char *)lParam, SKYPE_PROTONAME, wParam);
+ strncpy((char *)lParam, SKYPE_PROTONAME, wParam);
return 0; // Success
}
return 1; // Failure
diff --git a/protocols/SkypeWeb/src/skype_avatars.cpp b/protocols/SkypeWeb/src/skype_avatars.cpp index 91f992f6a9..9effeb2554 100644 --- a/protocols/SkypeWeb/src/skype_avatars.cpp +++ b/protocols/SkypeWeb/src/skype_avatars.cpp @@ -99,7 +99,7 @@ INT_PTR CSkypeProto::SvcGetAvatarInfo(WPARAM, LPARAM lParam) TCHAR tszFileName[MAX_PATH];
GetAvatarFileName(AI->hContact, tszFileName, SIZEOF(tszFileName));
- mir_tstrncpy(AI->filename, tszFileName, SIZEOF(AI->filename));
+ _tcsncpy(AI->filename, tszFileName, SIZEOF(AI->filename));
if (::_taccess(AI->filename, 0) == 0 && !getBool(AI->hContact, "NeedNewAvatar", 0))
return GAIR_SUCCESS;
@@ -118,7 +118,7 @@ INT_PTR CSkypeProto::SvcGetMyAvatar(WPARAM wParam, LPARAM lParam) {
TCHAR path[MAX_PATH];
GetAvatarFileName(NULL, path, SIZEOF(path));
- mir_tstrncpy((TCHAR*)wParam, path, (int)lParam);
+ _tcsncpy((TCHAR*)wParam, path, (int)lParam);
return 0;
}
diff --git a/protocols/Steam/src/steam_avatars.cpp b/protocols/Steam/src/steam_avatars.cpp index a8f4a811f9..ec2694b878 100644 --- a/protocols/Steam/src/steam_avatars.cpp +++ b/protocols/Steam/src/steam_avatars.cpp @@ -148,7 +148,7 @@ INT_PTR CSteamProto::GetMyAvatar(WPARAM wParam, LPARAM lParam) PROTO_AVATAR_INFORMATIONT ai = { sizeof(ai) };
switch (GetAvatarInfo(0, (LPARAM)&ai)) {
case GAIR_SUCCESS:
- mir_tstrncpy(buf, ai.filename, size);
+ _tcsncpy(buf, ai.filename, size);
buf[size - 1] = 0;
return 0;
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'; } } diff --git a/protocols/Tox/src/tox_transfer.cpp b/protocols/Tox/src/tox_transfer.cpp index 0b3d04b732..e1460b3d53 100644 --- a/protocols/Tox/src/tox_transfer.cpp +++ b/protocols/Tox/src/tox_transfer.cpp @@ -201,7 +201,7 @@ HANDLE CToxProto::OnSendFile(MCONTACT hContact, const PROTOCHAR*, PROTOCHAR **pp TCHAR *fileName = _tcsrchr(ppszFiles[0], '\\') + 1;
size_t fileDirLength = fileName - ppszFiles[0];
TCHAR *fileDir = (TCHAR*)mir_alloc(sizeof(TCHAR)*(fileDirLength + 1));
- mir_tstrncpy(fileDir, ppszFiles[0], fileDirLength);
+ _tcsncpy(fileDir, ppszFiles[0], fileDirLength);
fileDir[fileDirLength] = '\0';
_fseeki64(hFile, 0, SEEK_END);
diff --git a/protocols/Twitter/src/connection.cpp b/protocols/Twitter/src/connection.cpp index 79d0e354ff..f793b09e0a 100644 --- a/protocols/Twitter/src/connection.cpp +++ b/protocols/Twitter/src/connection.cpp @@ -412,7 +412,7 @@ void TwitterProto::UpdateAvatarWorker(void *p) return; // lets just ignore unknown formats... if not it crashes miranda. should probably speak to borkra about this.
}
- mir_tstrncpy(ai.filename, filename.c_str(), MAX_PATH); // puts the local file name in the avatar struct, to a max of 260 chars (as of now)
+ _tcsncpy(ai.filename, filename.c_str(), MAX_PATH); // puts the local file name in the avatar struct, to a max of 260 chars (as of now)
debugLogA("***** Updating avatar: %s", data->url.c_str());
mir_cslock lck(avatar_lock_);
@@ -536,7 +536,7 @@ void TwitterProto::ShowContactPopup(MCONTACT hContact, const std::string &text, DBVARIANT dbv;
if (!db_get_ts(hContact, "CList", "MyHandle", &dbv) || !db_get_ts(hContact, m_szModuleName, TWITTER_KEY_UN, &dbv)) {
- mir_tstrncpy(popup.lptzContactName, dbv.ptszVal, MAX_CONTACTNAME);
+ _tcsncpy(popup.lptzContactName, dbv.ptszVal, MAX_CONTACTNAME);
db_free(&dbv);
}
diff --git a/protocols/Twitter/src/ui.cpp b/protocols/Twitter/src/ui.cpp index 2dc2e9e6be..a0232d5da2 100644 --- a/protocols/Twitter/src/ui.cpp +++ b/protocols/Twitter/src/ui.cpp @@ -331,8 +331,8 @@ namespace popup_options // Pick a random quote
int q = rand() % SIZEOF(quotes);
- mir_tstrncpy(popup.lptzContactName, quotes[q].name, MAX_CONTACTNAME);
- mir_tstrncpy(popup.lptzText, quotes[q].text, MAX_SECONDLINE);
+ _tcsncpy(popup.lptzContactName, quotes[q].name, MAX_CONTACTNAME);
+ _tcsncpy(popup.lptzText, quotes[q].text, MAX_SECONDLINE);
popup.lchContact = hContact;
popup.iSeconds = get_timeout(hwndDlg);
diff --git a/protocols/VKontakte/src/vk_avatars.cpp b/protocols/VKontakte/src/vk_avatars.cpp index 09d64881be..85740be99c 100644 --- a/protocols/VKontakte/src/vk_avatars.cpp +++ b/protocols/VKontakte/src/vk_avatars.cpp @@ -81,7 +81,7 @@ INT_PTR CVkProto::SvcGetAvatarInfo(WPARAM, LPARAM lParam) TCHAR tszFileName[MAX_PATH];
GetAvatarFileName(AI->hContact, tszFileName, SIZEOF(tszFileName));
- mir_tstrncpy(AI->filename, tszFileName, SIZEOF(AI->filename));
+ _tcsncpy(AI->filename, tszFileName, SIZEOF(AI->filename));
AI->format = ProtoGetAvatarFormat(AI->filename);
@@ -117,7 +117,7 @@ INT_PTR CVkProto::SvcGetMyAvatar(WPARAM wParam, LPARAM lParam) TCHAR* buf = (TCHAR*)wParam;
int size = (int)lParam;
- mir_tstrncpy(buf, AI.filename, size);
+ _tcsncpy(buf, AI.filename, size);
buf[size - 1] = 0;
return 0;
diff --git a/protocols/Xfire/src/client.cpp b/protocols/Xfire/src/client.cpp index 4e0e7d1321..024cfc16d9 100644 --- a/protocols/Xfire/src/client.cpp +++ b/protocols/Xfire/src/client.cpp @@ -92,7 +92,7 @@ using namespace std; struct sockaddr_in sa;
int iLen = sizeof(sa);
getsockname(socket->m_sock, (SOCKADDR*)&sa, &iLen);
- mir_strncpy(this->localaddr,inet_ntoa(sa.sin_addr), sizeof(this->localaddr)-1);
+ strncpy(this->localaddr,inet_ntoa(sa.sin_addr), sizeof(this->localaddr)-1);
this->llocaladdr=inet_addr(this->localaddr);
packetReader->setSocket(socket);
diff --git a/protocols/Xfire/src/main.cpp b/protocols/Xfire/src/main.cpp index c6509ee017..0978600aaf 100644 --- a/protocols/Xfire/src/main.cpp +++ b/protocols/Xfire/src/main.cpp @@ -2833,7 +2833,7 @@ MCONTACT handlingBuddys(BuddyListEntry *entry, int clan, char*group, BOOL dontsc GameServerQuery_query gsqq = { 0 };
gsqq.port = gameob->port;
gsqq.xfiregameid = entry->game;
- mir_strncpy(gsqq.ip, temp, SIZEOF(gsqq.ip)-1);
+ strncpy(gsqq.ip, temp, SIZEOF(gsqq.ip)-1);
CallService("GameServerQuery/Query", (WPARAM)entry, (LPARAM)&gsqq);
}
}
@@ -3395,7 +3395,7 @@ INT_PTR GetAvatarInfo(WPARAM wParam, LPARAM lParam) { DBVARIANT dbv;
if (!db_get(pai->hContact, "ContactPhoto", "File", &dbv))
{
- mir_strncpy(pai->filename, dbv.pszVal, sizeof(pai->filename)-1);
+ strncpy(pai->filename, dbv.pszVal, sizeof(pai->filename)-1);
db_free(&dbv);
}
else
diff --git a/protocols/Xfire/src/searching4games.cpp b/protocols/Xfire/src/searching4games.cpp index 81bd3e9427..01fb52f082 100644 --- a/protocols/Xfire/src/searching4games.cpp +++ b/protocols/Xfire/src/searching4games.cpp @@ -67,7 +67,7 @@ BOOL CheckPath(char*ppath, char*pathwildcard = NULL) {
char temp[XFIRE_MAX_STATIC_STRING_LEN];
- mir_strncpy(temp, ppath,XFIRE_MAX_STATIC_STRING_LEN-1);
+ strncpy(temp, ppath,XFIRE_MAX_STATIC_STRING_LEN-1);
*(temp + mir_strlen(temp) - 1) = 0;
mir_strncat(temp, wfd.cFileName, SIZEOF(temp) - mir_strlen(temp));
mir_strncat(temp, "\\", SIZEOF(temp) - mir_strlen(temp));
diff --git a/protocols/Xfire/src/services.cpp b/protocols/Xfire/src/services.cpp index 2955dc85fc..380308cc14 100644 --- a/protocols/Xfire/src/services.cpp +++ b/protocols/Xfire/src/services.cpp @@ -58,7 +58,7 @@ INT_PTR GetMyAvatar(WPARAM wparam, LPARAM lparam) { if (!db_get(NULL, protocolname, "MyAvatarFile", &dbv))
{
- mir_strncpy((char*)wparam, dbv.pszVal, (int)lparam);
+ strncpy((char*)wparam, dbv.pszVal, (int)lparam);
db_free(&dbv);
return 0;
}
diff --git a/protocols/Xfire/src/tools.cpp b/protocols/Xfire/src/tools.cpp index 0b4ccc956d..05658e1ac8 100644 --- a/protocols/Xfire/src/tools.cpp +++ b/protocols/Xfire/src/tools.cpp @@ -211,7 +211,7 @@ char* GetLaunchPath(char*launch) if (launch == NULL) return temp; - mir_strncpy(temp, launch, XFIRE_MAX_STATIC_STRING_LEN -1); + strncpy(temp, launch, XFIRE_MAX_STATIC_STRING_LEN -1); while (*p != 0 && *f != 0) { diff --git a/protocols/Xfire/src/variables.cpp b/protocols/Xfire/src/variables.cpp index dd1d038f30..70f167e933 100644 --- a/protocols/Xfire/src/variables.cpp +++ b/protocols/Xfire/src/variables.cpp @@ -23,7 +23,7 @@ char* Varxfiregame(ARGUMENTSINFO *ai) DBVARIANT dbv3;
if (!db_get(ai->fi->hContact, protocolname, "RGame", &dbv3))
{
- mir_strncpy(temp, dbv3.pszVal, 255);
+ strncpy(temp, dbv3.pszVal, 255);
db_free(&dbv3);
return mir_strdup(temp);
}
diff --git a/protocols/Yahoo/src/avatar.cpp b/protocols/Yahoo/src/avatar.cpp index a269030c33..5b35f6b3d9 100644 --- a/protocols/Yahoo/src/avatar.cpp +++ b/protocols/Yahoo/src/avatar.cpp @@ -246,7 +246,7 @@ void __cdecl CYahooProto::recv_avatarthread(void *pavt) AI.cbSize = sizeof AI;
AI.format = PA_FORMAT_PNG;
AI.hContact = hContact;
- mir_tstrncpy(AI.filename, buf, SIZEOF(AI.filename)-1);
+ _tcsncpy(AI.filename, buf, SIZEOF(AI.filename)-1);
if (error)
setDword(hContact, "PictCK", 0);
diff --git a/protocols/Yahoo/src/yahoo.cpp b/protocols/Yahoo/src/yahoo.cpp index a2a20516cd..58c9089d4d 100644 --- a/protocols/Yahoo/src/yahoo.cpp +++ b/protocols/Yahoo/src/yahoo.cpp @@ -289,7 +289,7 @@ const char* CYahooProto::find_buddy( const char *yahoo_id) if (GetStringUtf(hContact, "Nick", &dbv))
return NULL;
- mir_strncpy(nick, dbv.pszVal, sizeof(nick)-1);
+ strncpy(nick, dbv.pszVal, sizeof(nick)-1);
db_free(&dbv);
return nick;
}
|