summaryrefslogtreecommitdiff
path: root/plugins/WhenWasIt/src/services.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-19 19:35:42 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-19 19:35:42 +0000
commit4c814798c7bc7f6a0f92c21b027b26290622aa2f (patch)
tree9bbfb38bd639f352300aa16ff7c45f5a9b2dba6d /plugins/WhenWasIt/src/services.cpp
parentf0f0cd088f1ec3a85abee825ddbc214f3f6b92c3 (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/WhenWasIt/src/services.cpp')
-rw-r--r--plugins/WhenWasIt/src/services.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/plugins/WhenWasIt/src/services.cpp b/plugins/WhenWasIt/src/services.cpp
index 3e392520c9..2130782dec 100644
--- a/plugins/WhenWasIt/src/services.cpp
+++ b/plugins/WhenWasIt/src/services.cpp
@@ -220,16 +220,16 @@ INT_PTR ImportBirthdaysService(WPARAM wParam, LPARAM lParam)
of.lStructSize = sizeof(OPENFILENAME);
//of.hInstance = hInstance;
TCHAR filter[MAX_PATH];
- mir_sntprintf(filter, SIZEOF(filter), _T("%s (*") _T(BIRTHDAY_EXTENSION) _T(")%c*") _T(BIRTHDAY_EXTENSION) _T("%c"), TranslateT("Birthdays files"), 0, 0);
+ mir_sntprintf(filter, _countof(filter), _T("%s (*") _T(BIRTHDAY_EXTENSION) _T(")%c*") _T(BIRTHDAY_EXTENSION) _T("%c"), TranslateT("Birthdays files"), 0, 0);
of.lpstrFilter = filter;
of.lpstrFile = fileName;
- of.nMaxFile = SIZEOF(fileName);
+ of.nMaxFile = _countof(fileName);
of.lpstrTitle = TranslateT("Please select a file to import birthdays from...");
of.Flags = OFN_FILEMUSTEXIST;
if (GetOpenFileName(&of)) {
TCHAR buffer[2048];
- mir_sntprintf(buffer, SIZEOF(buffer), TranslateT("Importing birthdays from file: %s"), fileName);
+ mir_sntprintf(buffer, _countof(buffer), TranslateT("Importing birthdays from file: %s"), fileName);
ShowPopupMessage(TranslateT("WhenWasIt"), buffer, hImportBirthdays);
DoImport(fileName);
ShowPopupMessage(TranslateT("WhenWasIt"), TranslateT("Done importing birthdays"), hImportBirthdays);
@@ -245,10 +245,10 @@ INT_PTR ExportBirthdaysService(WPARAM wParam, LPARAM lParam)
of.lStructSize = sizeof(OPENFILENAME);
//of.hInstance = hInstance;
TCHAR filter[MAX_PATH];
- mir_sntprintf(filter, SIZEOF(filter), _T("%s (*") _T(BIRTHDAY_EXTENSION) _T(")%c*") _T(BIRTHDAY_EXTENSION) _T("%c%s (*.*)%c*.*%c"), TranslateT("Birthdays files"), 0, 0, TranslateT("All Files"), 0, 0);
+ mir_sntprintf(filter, _countof(filter), _T("%s (*") _T(BIRTHDAY_EXTENSION) _T(")%c*") _T(BIRTHDAY_EXTENSION) _T("%c%s (*.*)%c*.*%c"), TranslateT("Birthdays files"), 0, 0, TranslateT("All Files"), 0, 0);
of.lpstrFilter = filter;
of.lpstrFile = fileName;
- of.nMaxFile = SIZEOF(fileName);
+ of.nMaxFile = _countof(fileName);
of.lpstrTitle = TranslateT("Please select a file to export birthdays to...");
if (GetSaveFileName(&of)) {
@@ -257,7 +257,7 @@ INT_PTR ExportBirthdaysService(WPARAM wParam, LPARAM lParam)
if (!_tcschr(fn, _T('.')))
mir_tstrcat(fileName, _T(BIRTHDAY_EXTENSION));
- mir_sntprintf(buffer, SIZEOF(buffer), TranslateT("Exporting birthdays to file: %s"), fileName);
+ mir_sntprintf(buffer, _countof(buffer), TranslateT("Exporting birthdays to file: %s"), fileName);
ShowPopupMessage(TranslateT("WhenWasIt"), buffer, hExportBirthdays);
DoExport(fileName);
ShowPopupMessage(TranslateT("WhenWasIt"), TranslateT("Done exporting birthdays"), hExportBirthdays);
@@ -278,7 +278,7 @@ int DoImport(TCHAR *fileName)
while (!feof(fin)) {
TCHAR buffer[4096];
- _fgetts(buffer, SIZEOF(buffer), fin);
+ _fgetts(buffer, _countof(buffer), fin);
if (buffer[0] == _T(COMMENT_CHAR))
continue;
@@ -304,7 +304,7 @@ int DoImport(TCHAR *fileName)
}
else {
TCHAR tmp[2048];
- mir_sntprintf(tmp, SIZEOF(tmp), TranslateT(NOTFOUND_FORMAT), szHandle, szProto);
+ mir_sntprintf(tmp, _countof(tmp), TranslateT(NOTFOUND_FORMAT), szHandle, szProto);
ShowPopupMessage(TranslateT("Warning"), tmp, hImportBirthdays);
}
}