diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-19 19:35:42 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-19 19:35:42 +0000 |
commit | 4c814798c7bc7f6a0f92c21b027b26290622aa2f (patch) | |
tree | 9bbfb38bd639f352300aa16ff7c45f5a9b2dba6d /plugins/TrafficCounter/src/misc.cpp | |
parent | f0f0cd088f1ec3a85abee825ddbc214f3f6b92c3 (diff) |
SIZEOF replaced with more secure analog - _countof
git-svn-id: http://svn.miranda-ng.org/main/trunk@14270 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TrafficCounter/src/misc.cpp')
-rw-r--r-- | plugins/TrafficCounter/src/misc.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/plugins/TrafficCounter/src/misc.cpp b/plugins/TrafficCounter/src/misc.cpp index fa304ad0de..2febe16560 100644 --- a/plugins/TrafficCounter/src/misc.cpp +++ b/plugins/TrafficCounter/src/misc.cpp @@ -153,7 +153,7 @@ size_t GetFormattedTraffic(DWORD Value, BYTE Unit, TCHAR *Buffer, size_t Size) return 0;
}
- mir_sntprintf(Str1, SIZEOF(Str1), _T("%d.%d"), Value / Divider, Value % Divider);
+ mir_sntprintf(Str1, _countof(Str1), _T("%d.%d"), Value / Divider, Value % Divider);
size_t l = GetNumberFormat(LOCALE_USER_DEFAULT, 0, Str1, &nf, NULL, 0);
if (!l) return 0;
l += mir_tstrlen(szUnit) + 1;
@@ -210,49 +210,49 @@ size_t GetDurationFormatM(DWORD Duration, TCHAR *Format, TCHAR *Buffer, WORD Siz if (!mir_tstrcmp(Token, _T("d")))
{
q = Duration / (60 * 60 * 24);
- mir_sntprintf(Token, SIZEOF(Token), _T("%d"), q);
+ mir_sntprintf(Token, _countof(Token), _T("%d"), q);
Duration -= q * 60 * 60 * 24;
}
else
if (!mir_tstrcmp(Token, _T("h")))
{
q = Duration / (60 * 60);
- mir_sntprintf(Token, SIZEOF(Token), _T("%d"), q);
+ mir_sntprintf(Token, _countof(Token), _T("%d"), q);
Duration -= q * 60 * 60;
}
else
if (!mir_tstrcmp(Token, _T("hh")))
{
q = Duration / (60 * 60);
- mir_sntprintf(Token, SIZEOF(Token), _T("%02d"), q);
+ mir_sntprintf(Token, _countof(Token), _T("%02d"), q);
Duration -= q * 60 * 60;
}
else
if (!mir_tstrcmp(Token, _T("m")))
{
q = Duration / 60;
- mir_sntprintf(Token, SIZEOF(Token), _T("%d"), q);
+ mir_sntprintf(Token, _countof(Token), _T("%d"), q);
Duration -= q * 60;
}
else
if (!mir_tstrcmp(Token, _T("mm")))
{
q = Duration / 60;
- mir_sntprintf(Token, SIZEOF(Token), _T("%02d"), q);
+ mir_sntprintf(Token, _countof(Token), _T("%02d"), q);
Duration -= q * 60;
}
else
if (!mir_tstrcmp(Token, _T("s")))
{
q = Duration;
- mir_sntprintf(Token, SIZEOF(Token), _T("%d"), q);
+ mir_sntprintf(Token, _countof(Token), _T("%d"), q);
Duration -= q;
}
else
if (!mir_tstrcmp(Token, _T("ss")))
{
q = Duration;
- mir_sntprintf(Token, SIZEOF(Token), _T("%02d"), q);
+ mir_sntprintf(Token, _countof(Token), _T("%02d"), q);
Duration -= q;
}
|