diff options
author | Rozhuk Ivan <rozhuk.im@gmail.com> | 2014-12-09 00:59:27 +0000 |
---|---|---|
committer | Rozhuk Ivan <rozhuk.im@gmail.com> | 2014-12-09 00:59:27 +0000 |
commit | 36472b00443e23acf28b0dd26ddc2c2e6216d909 (patch) | |
tree | a526bbc6d309e05f1728b772620c9272f9ab8c4a /plugins/TrafficCounter/src/misc.cpp | |
parent | 163ce5127e5c8244bccbdae72107ad101f70575f (diff) |
code cleanup over mir_sntprintf + small bug fix
git-svn-id: http://svn.miranda-ng.org/main/trunk@11295 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 cf1215ec8a..afbc60e841 100644 --- a/plugins/TrafficCounter/src/misc.cpp +++ b/plugins/TrafficCounter/src/misc.cpp @@ -152,7 +152,7 @@ WORD GetFormattedTraffic(DWORD Value, BYTE Unit, TCHAR *Buffer, WORD Size) break;
}
- mir_sntprintf(Str1, 32, _T("%d.%d"), Value / Divider, Value % Divider);
+ mir_sntprintf(Str1, SIZEOF(Str1), _T("%d.%d"), Value / Divider, Value % Divider);
l = GetNumberFormat(LOCALE_USER_DEFAULT, 0, Str1, &nf, NULL, 0);
if (!l) return 0;
l += _tcslen(szUnit) + 1;
@@ -208,49 +208,49 @@ WORD GetDurationFormatM(DWORD Duration, TCHAR *Format, TCHAR *Buffer, WORD Size) if (!_tcscmp(Token, _T("d")))
{
q = Duration / (60 * 60 * 24);
- mir_sntprintf(Token, 256, _T("%d"), q);
+ mir_sntprintf(Token, SIZEOF(Token), _T("%d"), q);
Duration -= q * 60 * 60 * 24;
}
else
if (!_tcscmp(Token, _T("h")))
{
q = Duration / (60 * 60);
- mir_sntprintf(Token, 256, _T("%d"), q);
+ mir_sntprintf(Token, SIZEOF(Token), _T("%d"), q);
Duration -= q * 60 * 60;
}
else
if (!_tcscmp(Token, _T("hh")))
{
q = Duration / (60 * 60);
- mir_sntprintf(Token, 256, _T("%02d"), q);
+ mir_sntprintf(Token, SIZEOF(Token), _T("%02d"), q);
Duration -= q * 60 * 60;
}
else
if (!_tcscmp(Token, _T("m")))
{
q = Duration / 60;
- mir_sntprintf(Token, 256, _T("%d"), q);
+ mir_sntprintf(Token, SIZEOF(Token), _T("%d"), q);
Duration -= q * 60;
}
else
if (!_tcscmp(Token, _T("mm")))
{
q = Duration / 60;
- mir_sntprintf(Token, 256, _T("%02d"), q);
+ mir_sntprintf(Token, SIZEOF(Token), _T("%02d"), q);
Duration -= q * 60;
}
else
if (!_tcscmp(Token, _T("s")))
{
q = Duration;
- mir_sntprintf(Token, 256, _T("%d"), q);
+ mir_sntprintf(Token, SIZEOF(Token), _T("%d"), q);
Duration -= q;
}
else
if (!_tcscmp(Token, _T("ss")))
{
q = Duration;
- mir_sntprintf(Token, 256, _T("%02d"), q);
+ mir_sntprintf(Token, SIZEOF(Token), _T("%02d"), q);
Duration -= q;
}
|