From a757184e5db3112d3de0b69eec7d39b937e396bc Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Thu, 25 Jul 2013 15:32:06 +0000 Subject: replace sprintf to mir_snprintf (part 5) git-svn-id: http://svn.miranda-ng.org/main/trunk@5481 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/WhenWasIt/src/icons.cpp | 6 +++--- plugins/WhenWasIt/src/utils.cpp | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'plugins/WhenWasIt/src') diff --git a/plugins/WhenWasIt/src/icons.cpp b/plugins/WhenWasIt/src/icons.cpp index 60afbf4fc4..3a9d670b8a 100644 --- a/plugins/WhenWasIt/src/icons.cpp +++ b/plugins/WhenWasIt/src/icons.cpp @@ -60,11 +60,11 @@ int AddIcons() hDTB[0] = AddIcon("DTB0", LPGEN("Birthday today"), tszPath, IDI_DTB0); hDTB[1] = AddIcon("DTB1", LPGEN("1 day to birthday"), tszPath, IDI_DTB1); for (int i = 2; i < cDTB; i++) { - sprintf(name, "DTB%d", i); - sprintf(description, Translate("%d days to birthday"), i); + mir_snprintf(name, SIZEOF(name), "DTB%d", i); + mir_snprintf(description, SIZEOF(description), Translate("%d days to birthday"), i); hDTB[i] = AddIcon(name, description, tszPath, IDI_DTB0+i); } - sprintf(description, Translate("More than %d days to birthday"), cDTB - 1); + mir_snprintf(description, SIZEOF(description), Translate("More than %d days to birthday"), cDTB - 1); hDTBMore = AddIcon("DTBMore", description, tszPath, IDI_DTBMORE); hWWIExtraIcons = ExtraIcon_Register("WhenWasIt", LPGEN("WhenWasIt birthday reminder"), "MenuCheck"); diff --git a/plugins/WhenWasIt/src/utils.cpp b/plugins/WhenWasIt/src/utils.cpp index 323e63d979..a2f2bb6ade 100644 --- a/plugins/WhenWasIt/src/utils.cpp +++ b/plugins/WhenWasIt/src/utils.cpp @@ -47,7 +47,7 @@ int Log(char *format, ...) fputs(str, fout); va_start(vararg, format); - tBytes = _vsnprintf(str, sizeof(str), format, vararg); + tBytes = mir_vsnprintf(str, sizeof(str), format, vararg); if (tBytes > 0) { str[tBytes] = 0; @@ -70,7 +70,7 @@ int Info(char *title, char *format, ...) va_list vararg; int tBytes; va_start(vararg, format); - tBytes = _vsnprintf(str, sizeof(str), format, vararg); + tBytes = mir_vsnprintf(str, sizeof(str), format, vararg); if (tBytes > 0) { str[tBytes] = 0; @@ -88,12 +88,12 @@ char *BinToHex(int size, PBYTE data) int maxSize = size * 2 + HEX_SIZE + 1; szresult = (char *) new char[ maxSize ]; memset(szresult, 0, maxSize); - sprintf(buffer, "%0*X", HEX_SIZE, size); + mir_snprintf(buffer, SIZEOF(buffer), "%0*X", HEX_SIZE, size); strcpy(szresult, buffer); int i; for (i = 0; i < size; i++) { - sprintf(buffer, "%02X", data[i]); + mir_snprintf(buffer, SIZEOF(buffer), "%02X", data[i]); strcpy(szresult + (HEX_SIZE + i * 2), buffer); } return szresult; @@ -193,17 +193,17 @@ TCHAR *GetContactID(HANDLE hContact, char *szProto) TCHAR tmp[16]; switch (ctInfo.type) { case CNFT_BYTE: - _stprintf(tmp, _T("%d"), ctInfo.bVal); + mir_sntprintf(tmp, SIZEOF(tmp), _T("%d"), ctInfo.bVal); buffer = _tcsdup(tmp); break; case CNFT_WORD: - _stprintf(tmp, _T("%d"), ctInfo.wVal); + mir_sntprintf(tmp, SIZEOF(tmp), _T("%d"), ctInfo.wVal); buffer = _tcsdup(tmp); break; case CNFT_DWORD: - _stprintf(tmp, _T("%ld"), ctInfo.dVal); + mir_sntprintf(tmp, SIZEOF(tmp), _T("%ld"), ctInfo.dVal); buffer = _tcsdup(tmp); break; -- cgit v1.2.3