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 /src/modules | |
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 'src/modules')
-rw-r--r-- | src/modules/database/dbutils.cpp | 4 | ||||
-rw-r--r-- | src/modules/fonts/FontOptions.cpp | 2 | ||||
-rw-r--r-- | src/modules/fonts/FontService.cpp | 8 | ||||
-rw-r--r-- | src/modules/metacontacts/meta_services.cpp | 4 | ||||
-rw-r--r-- | src/modules/netlib/netlibhttp.cpp | 2 | ||||
-rw-r--r-- | src/modules/netlib/netlibsecurity.cpp | 2 | ||||
-rw-r--r-- | src/modules/netlib/netlibsock.cpp | 2 | ||||
-rw-r--r-- | src/modules/netlib/netlibupnp.cpp | 12 | ||||
-rw-r--r-- | src/modules/protocols/protochains.cpp | 2 |
9 files changed, 19 insertions, 19 deletions
diff --git a/src/modules/database/dbutils.cpp b/src/modules/database/dbutils.cpp index 91b1f170b4..2e7ef5de9e 100644 --- a/src/modules/database/dbutils.cpp +++ b/src/modules/database/dbutils.cpp @@ -282,7 +282,7 @@ static INT_PTR GetProfilePath(WPARAM wParam, LPARAM lParam) return 1;
char *dst = (char*)lParam;
- mir_strncpy(dst, _T2A(g_profileDir), wParam);
+ strncpy(dst, _T2A(g_profileDir), wParam);
dst[wParam-1] = 0;
return 0;
}
@@ -295,7 +295,7 @@ static INT_PTR GetProfileName(WPARAM wParam, LPARAM lParam) char *dst = (char*)lParam;
char *tmp = makeFileName(g_profileName);
- mir_strncpy(dst, tmp, wParam);
+ strncpy(dst, tmp, wParam);
mir_free(tmp);
dst[wParam-1] = 0;
diff --git a/src/modules/fonts/FontOptions.cpp b/src/modules/fonts/FontOptions.cpp index 45f79e0713..6efdc67f7d 100644 --- a/src/modules/fonts/FontOptions.cpp +++ b/src/modules/fonts/FontOptions.cpp @@ -149,7 +149,7 @@ static BOOL ExportSettings(HWND hwndDlg, const TCHAR *filename, OBJLIST<FontInte mir_snprintf(buff, SIZEOF(buff), "\n[%s]", F.dbSettingsGroup);
if (mir_strcmp(buff, header) != 0) {
- mir_strncpy(header, buff, SIZEOF(header));
+ strncpy(header, buff, SIZEOF(header));
WriteLine(out, buff);
}
diff --git a/src/modules/fonts/FontService.cpp b/src/modules/fonts/FontService.cpp index d8f6dac156..166110f2a8 100644 --- a/src/modules/fonts/FontService.cpp +++ b/src/modules/fonts/FontService.cpp @@ -90,22 +90,22 @@ int LoadFontserviceModule(void) // create generic fonts
FontIDT fontid = { sizeof(fontid) };
- mir_strncpy(fontid.dbSettingsGroup, "Fonts", sizeof(fontid.dbSettingsGroup));
+ strncpy(fontid.dbSettingsGroup, "Fonts", sizeof(fontid.dbSettingsGroup));
_tcsncpy_s(fontid.group, LPGENT("General"), _TRUNCATE);
_tcsncpy_s(fontid.name, LPGENT("Headers"), _TRUNCATE);
fontid.flags = FIDF_APPENDNAME | FIDF_NOAS | FIDF_SAVEPOINTSIZE | FIDF_ALLOWEFFECTS | FIDF_CLASSHEADER;
- mir_strncpy(fontid.prefix, "Header", SIZEOF(fontid.prefix));
+ strncpy(fontid.prefix, "Header", SIZEOF(fontid.prefix));
FontRegisterT(&fontid);
_tcsncpy_s(fontid.name, LPGENT("Generic text"), _TRUNCATE);
fontid.flags = FIDF_APPENDNAME | FIDF_NOAS | FIDF_SAVEPOINTSIZE | FIDF_ALLOWEFFECTS | FIDF_CLASSGENERAL;
- mir_strncpy(fontid.prefix, "Generic", SIZEOF(fontid.prefix));
+ strncpy(fontid.prefix, "Generic", SIZEOF(fontid.prefix));
FontRegisterT(&fontid);
_tcsncpy_s(fontid.name, LPGENT("Small text"), _TRUNCATE);
fontid.flags = FIDF_APPENDNAME | FIDF_NOAS | FIDF_SAVEPOINTSIZE | FIDF_ALLOWEFFECTS | FIDF_CLASSSMALL;
- mir_strncpy(fontid.prefix, "Small", SIZEOF(fontid.prefix));
+ strncpy(fontid.prefix, "Small", SIZEOF(fontid.prefix));
FontRegisterT(&fontid);
// do last for silly dyna plugin
diff --git a/src/modules/metacontacts/meta_services.cpp b/src/modules/metacontacts/meta_services.cpp index 3d50e8a455..f550d4edbd 100644 --- a/src/modules/metacontacts/meta_services.cpp +++ b/src/modules/metacontacts/meta_services.cpp @@ -83,7 +83,7 @@ INT_PTR Meta_GetName(WPARAM wParam, LPARAM lParam) {
char *name = (char *)Translate(META_PROTO);
size_t size = min(mir_strlen(name), wParam - 1); // copy only the first size bytes.
- if (mir_strncpy((char *)lParam, name, size) == NULL)
+ if (strncpy((char *)lParam, name, size) == NULL)
return 1;
((char *)lParam)[size] = '\0';
return 0;
@@ -243,7 +243,7 @@ INT_PTR Meta_SendMessage(WPARAM wParam, LPARAM lParam) tfap->hContact = ccs->hContact;
tfap->hEvent = hEvent;
tfap->id = 10;
- mir_strncpy(tfap->msg, Translate("No online contacts found."), SIZEOF(tfap->msg) - 1);
+ strncpy(tfap->msg, Translate("No online contacts found."), SIZEOF(tfap->msg) - 1);
CloseHandle(mir_forkthread(sttFakeAckFail, (void*)tfap));
SetEvent(hEvent);
diff --git a/src/modules/netlib/netlibhttp.cpp b/src/modules/netlib/netlibhttp.cpp index a30a15f2bf..cd7a173f1a 100644 --- a/src/modules/netlib/netlibhttp.cpp +++ b/src/modules/netlib/netlibhttp.cpp @@ -583,7 +583,7 @@ INT_PTR NetlibHttpSendRequest(WPARAM wParam, LPARAM lParam) nlc->szNewUrl = (char*)mir_realloc(nlc->szNewUrl, rlen + mir_strlen(tmpUrl) * 3 + 1);
- mir_strncpy(nlc->szNewUrl, pszFullUrl, rlen);
+ strncpy(nlc->szNewUrl, pszFullUrl, rlen);
mir_strcpy(nlc->szNewUrl + rlen, tmpUrl);
pszFullUrl = nlc->szNewUrl;
pszUrl = NULL;
diff --git a/src/modules/netlib/netlibsecurity.cpp b/src/modules/netlib/netlibsecurity.cpp index a00f667076..31873e94a7 100644 --- a/src/modules/netlib/netlibsecurity.cpp +++ b/src/modules/netlib/netlibsecurity.cpp @@ -292,7 +292,7 @@ char* NtlmCreateResponseFromChallenge(HANDLE hSecurity, const char *szChallenge, size_t newLoginLen = mir_tstrlen(login) + domainLen + 1;
TCHAR *newLogin = (TCHAR*)alloca(newLoginLen * sizeof(TCHAR));
- mir_tstrncpy(newLogin, domainName, domainLen);
+ _tcsncpy(newLogin, domainName, domainLen);
newLogin[domainLen] = '\\';
mir_tstrcpy(newLogin + domainLen + 1, login);
diff --git a/src/modules/netlib/netlibsock.cpp b/src/modules/netlib/netlibsock.cpp index 5aaea3613a..e53e73bd89 100644 --- a/src/modules/netlib/netlibsock.cpp +++ b/src/modules/netlib/netlibsock.cpp @@ -237,7 +237,7 @@ void NetlibGetConnectionInfo(NetlibConnection* nlc, NETLIBCONNINFO *connInfo) connInfo->dwIpv4 = sin.si_family == AF_INET ? htonl(sin.Ipv4.sin_addr.s_addr) : 0;
char *szTmp = NetlibAddressToString(&sin);
- mir_strncpy(connInfo->szIpPort, szTmp, sizeof(connInfo->szIpPort));
+ strncpy(connInfo->szIpPort, szTmp, sizeof(connInfo->szIpPort));
connInfo->szIpPort[sizeof(connInfo->szIpPort) - 1] = 0;
mir_free(szTmp);
}
diff --git a/src/modules/netlib/netlibupnp.cpp b/src/modules/netlib/netlibupnp.cpp index 54fc04d640..2e3445126f 100644 --- a/src/modules/netlib/netlibupnp.cpp +++ b/src/modules/netlib/netlibupnp.cpp @@ -147,7 +147,7 @@ static bool txtParseParam(char* szData, char* presearch, while (*(cp1-1) == ' ' && cp1 > cp) --cp1;
len = min((size_t)(cp1 - cp), size-1);
- mir_strncpy(param, cp, len);
+ strncpy(param, cp, len);
param[len] = 0;
return true;
@@ -171,7 +171,7 @@ void parseURL(char* szUrl, char* szHost, unsigned short* sPort, char* szPath) if (szHost != NULL) {
sz = pport - phost + 1;
if (sz > 256) sz = 256;
- mir_strncpy(szHost, phost, sz);
+ strncpy(szHost, phost, sz);
szHost[sz - 1] = 0;
}
@@ -185,7 +185,7 @@ void parseURL(char* szUrl, char* szHost, unsigned short* sPort, char* szPath) }
if (szPath != NULL) {
- mir_strncpy(szPath, ppath, 256);
+ strncpy(szPath, ppath, 256);
szPath[255] = 0;
}
}
@@ -514,7 +514,7 @@ static bool getUPnPURLs(char* szUrl, size_t sizeUrl) size_t ctlLen;
txtParseParam(szData, NULL, "<URLBase>", "</URLBase>", szTemp, sizeof(szTemp));
- mir_strncpy(szCtlUrl, szTemp[0] ? szTemp : szUrl, sizeof(szCtlUrl));
+ strncpy(szCtlUrl, szTemp[0] ? szTemp : szUrl, sizeof(szCtlUrl));
szCtlUrl[sizeof(szCtlUrl) - 1] = 0;
mir_snprintf(szTemp, SIZEOF(szTemp), search_device, szDev);
@@ -541,11 +541,11 @@ static bool getUPnPURLs(char* szUrl, size_t sizeUrl) size_t ctlCLen = mir_strlen(szCtlUrl);
rpth = szCtlUrl + ctlCLen;
if (ctlCLen != 0 && *(rpth - 1) != '/')
- mir_strncpy(rpth++, "/", sizeof(szCtlUrl) - ctlCLen);
+ strncpy(rpth++, "/", sizeof(szCtlUrl) - ctlCLen);
}
ctlLen = sizeof(szCtlUrl) - (rpth - szCtlUrl);
- mir_strncpy(rpth, szUrl, ctlLen);
+ strncpy(rpth, szUrl, ctlLen);
szCtlUrl[sizeof(szCtlUrl) - 1] = 0;
}
else {
diff --git a/src/modules/protocols/protochains.cpp b/src/modules/protocols/protochains.cpp index b664922f49..be760d9877 100644 --- a/src/modules/protocols/protochains.cpp +++ b/src/modules/protocols/protochains.cpp @@ -34,7 +34,7 @@ static int GetProtocolP(MCONTACT hContact, char *szBuf, int cbLen) DBCachedContact *cc = currDb->m_cache->GetCachedContact(hContact);
if (cc && cc->szProto != NULL) {
- mir_strncpy(szBuf, cc->szProto, cbLen);
+ strncpy(szBuf, cc->szProto, cbLen);
szBuf[cbLen - 1] = 0;
return 0;
}
|