summaryrefslogtreecommitdiff
path: root/plugins/WhenWasIt
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2013-07-25 15:32:06 +0000
committerKirill Volinsky <mataes2007@gmail.com>2013-07-25 15:32:06 +0000
commita757184e5db3112d3de0b69eec7d39b937e396bc (patch)
treee903787b3ca3af22a4d95ddf757e178b23da8619 /plugins/WhenWasIt
parent33ebc5347bee5432ca63efb330acdd5a3b82f3fd (diff)
replace sprintf to mir_snprintf (part 5)
git-svn-id: http://svn.miranda-ng.org/main/trunk@5481 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/WhenWasIt')
-rw-r--r--plugins/WhenWasIt/src/icons.cpp6
-rw-r--r--plugins/WhenWasIt/src/utils.cpp14
2 files changed, 10 insertions, 10 deletions
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;