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/Db3x_mmap/src/database.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/Db3x_mmap/src/database.cpp')
-rw-r--r-- | plugins/Db3x_mmap/src/database.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins/Db3x_mmap/src/database.cpp b/plugins/Db3x_mmap/src/database.cpp index aa28878fad..d095b64df0 100644 --- a/plugins/Db3x_mmap/src/database.cpp +++ b/plugins/Db3x_mmap/src/database.cpp @@ -87,7 +87,7 @@ void __cdecl dbpanic(void *) msg = TranslateT("Disk is full. Miranda will now shut down.");
TCHAR err[256];
- mir_sntprintf(err, SIZEOF(err), msg, TranslateT("Database failure. Miranda will now shut down."), dwErr);
+ mir_sntprintf(err, _countof(err), msg, TranslateT("Database failure. Miranda will now shut down."), dwErr);
MessageBox(0, err, TranslateT("Database Error"), MB_SETFOREGROUND | MB_TOPMOST | MB_APPLMODAL | MB_ICONWARNING | MB_OK);
}
@@ -128,13 +128,13 @@ char* printVariant(DBVARIANT* p) static char boo[1000];
switch (p->type) {
- case DBVT_BYTE: mir_snprintf(boo, SIZEOF(boo), "byte: %d", p->bVal ); break;
- case DBVT_WORD: mir_snprintf(boo, SIZEOF(boo), "word: %d", p->wVal ); break;
- case DBVT_DWORD: mir_snprintf(boo, SIZEOF(boo), "dword: %d", p->dVal ); break;
+ case DBVT_BYTE: mir_snprintf(boo, _countof(boo), "byte: %d", p->bVal ); break;
+ case DBVT_WORD: mir_snprintf(boo, _countof(boo), "word: %d", p->wVal ); break;
+ case DBVT_DWORD: mir_snprintf(boo, _countof(boo), "dword: %d", p->dVal ); break;
case DBVT_UTF8:
- case DBVT_ASCIIZ: mir_snprintf(boo, SIZEOF(boo), "string: '%s'", p->pszVal); break;
+ case DBVT_ASCIIZ: mir_snprintf(boo, _countof(boo), "string: '%s'", p->pszVal); break;
case DBVT_DELETED: mir_strcpy(boo, "deleted"); break;
- default: mir_snprintf(boo, SIZEOF(boo), "crap: %d", p->type ); break;
+ default: mir_snprintf(boo, _countof(boo), "crap: %d", p->type ); break;
}
return boo;
}
|