diff options
author | Rozhuk Ivan <rozhuk.im@gmail.com> | 2014-12-02 05:19:23 +0000 |
---|---|---|
committer | Rozhuk Ivan <rozhuk.im@gmail.com> | 2014-12-02 05:19:23 +0000 |
commit | 114f83d5d8a73b3f1435e09b1d91aff843e4ce15 (patch) | |
tree | 0805188bf6bcf5749d1e76d5d1e73ccb6cf41cc4 /plugins/Clist_nicer/src | |
parent | 6e2b6b31bae6d69bff5271451e73eb08637b8118 (diff) |
mir_snprintf(..., "%s", ...) -> strncpy_s(...)
build fix to prevous commit
git-svn-id: http://svn.miranda-ng.org/main/trunk@11212 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_nicer/src')
-rw-r--r-- | plugins/Clist_nicer/src/clcutils.cpp | 1 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/extBackg.cpp | 14 |
2 files changed, 8 insertions, 7 deletions
diff --git a/plugins/Clist_nicer/src/clcutils.cpp b/plugins/Clist_nicer/src/clcutils.cpp index c700c5607c..f8026b4d2e 100644 --- a/plugins/Clist_nicer/src/clcutils.cpp +++ b/plugins/Clist_nicer/src/clcutils.cpp @@ -90,6 +90,7 @@ size_t MY_pathToAbsolute(const TCHAR *pSrc, TCHAR *pOut) memcpy(pOut, pSrc, (dwSrcLen * sizeof(TCHAR)));
pOut[dwSrcLen] = 0;
return dwSrcLen;
+ }
if (pSrc[0] == '.')
return (mir_sntprintf(pOut, MAX_PATH, _T("%s\\%s"), cfg::dat.tszProfilePath, pSrc));
diff --git a/plugins/Clist_nicer/src/extBackg.cpp b/plugins/Clist_nicer/src/extBackg.cpp index d124c0cedc..74e848468d 100644 --- a/plugins/Clist_nicer/src/extBackg.cpp +++ b/plugins/Clist_nicer/src/extBackg.cpp @@ -973,7 +973,7 @@ static void BTN_ReadItem(char *itemName, char *file) ImageItem *imgItem = g_ImageItems;
memset(&tmpItem, 0, sizeof(tmpItem));
- mir_snprintf(tmpItem.szName, SIZEOF(tmpItem.szName), "%s", &itemName[1]);
+ strncpy_s(tmpItem.szName, &itemName[1], _TRUNCATE);
tmpItem.width = GetPrivateProfileIntA(itemName, "Width", 16, file);
tmpItem.height = GetPrivateProfileIntA(itemName, "Height", 16, file);
tmpItem.xOff = GetPrivateProfileIntA(itemName, "xoff", 0, file);
@@ -1048,7 +1048,7 @@ static void BTN_ReadItem(char *itemName, char *file) tmpItem.szService[0] = 0;
GetPrivateProfileStringA(itemName, "Service", "None", szBuffer, 1000, file);
if (_stricmp(szBuffer, "None")) {
- mir_snprintf(tmpItem.szService, 256, "%s", szBuffer);
+ strncpy_s(tmpItem.szService, szBuffer, _TRUNCATE);
tmpItem.dwFlags |= BUTTON_ISSERVICE;
tmpItem.uId = nextButtonID++;
}
@@ -1057,7 +1057,7 @@ static void BTN_ReadItem(char *itemName, char *file) tmpItem.szService[0] = 0;
GetPrivateProfileStringA(itemName, "Service", "None", szBuffer, 1000, file);
if (_stricmp(szBuffer, "None")) {
- mir_snprintf(tmpItem.szService, 256, "%s", szBuffer);
+ strncpy_s(tmpItem.szService, szBuffer, _TRUNCATE);
tmpItem.dwFlags |= BUTTON_ISPROTOSERVICE;
tmpItem.uId = nextButtonID++;
}
@@ -1067,10 +1067,10 @@ static void BTN_ReadItem(char *itemName, char *file) GetPrivateProfileStringA(itemName, "Module", "None", szBuffer, 1000, file);
if (_stricmp(szBuffer, "None"))
- mir_snprintf(tmpItem.szModule, 256, "%s", szBuffer);
+ strncpy_s(tmpItem.szModule, szBuffer, _TRUNCATE);
GetPrivateProfileStringA(itemName, "Setting", "None", szBuffer, 1000, file);
if (_stricmp(szBuffer, "None"))
- mir_snprintf(tmpItem.szSetting, 256, "%s", szBuffer);
+ strncpy_s(tmpItem.szSetting, szBuffer, _TRUNCATE);
if (GetPrivateProfileIntA(itemName, "contact", 0, file) != 0)
tmpItem.dwFlags |= BUTTON_DBACTIONONCONTACT;
@@ -1286,10 +1286,10 @@ void LoadPerContactSkins(TCHAR *tszFileName) char UIN[40];
switch (dbv.type) {
case DBVT_DWORD:
- mir_snprintf(UIN, 40, "%d", dbv.dVal);
+ mir_snprintf(UIN, SIZEOF(UIN), "%d", dbv.dVal);
break;
case DBVT_ASCIIZ:
- mir_snprintf(UIN, 40, "%s", dbv.pszVal);
+ strncpy_s(UIN, dbv.pszVal, _TRUNCATE);
db_free(&dbv);
break;
default:
|