VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/Exception.h
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2016-02-07 02:07:38 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2016-02-07 02:39:43 +0100
commitae7ec4802a81770ff164e465b8d1fb51624ca093 (patch)
tree369c0ddf810ea03ae2d1426a661b54ca5288c34c /src/Common/Exception.h
parent229bd668f414cac163d12be9a3284b79d95b4ac0 (diff)
downloadVeraCrypt-ae7ec4802a81770ff164e465b8d1fb51624ca093.tar.gz
VeraCrypt-ae7ec4802a81770ff164e465b8d1fb51624ca093.zip
Windows:Fix various issues and warnings reported by static code analysis tool Coverity.
Diffstat (limited to 'src/Common/Exception.h')
-rw-r--r--src/Common/Exception.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Common/Exception.h b/src/Common/Exception.h
index a54f803d..f3635a1d 100644
--- a/src/Common/Exception.h
+++ b/src/Common/Exception.h
@@ -77,7 +77,7 @@ namespace VeraCrypt
void Show (HWND parent) const
{
char szErrCode[16];
- StringCbPrintfA (szErrCode, sizeof(szErrCode), "0x%.8X", LastError);
+ StringCchPrintfA (szErrCode, ARRAYSIZE(szErrCode), "0x%.8X", LastError);
string msgBody = "The Random Generator initialization failed.\n\n\n(If you report a bug in connection with this, please include the following technical information in the bug report:\n" + string (SrcPos) + "\nLast Error = " + string (szErrCode) + ")";
MessageBoxA (parent, msgBody.c_str(), "VeraCrypt", MB_ICONERROR | MB_SETFOREGROUND);
}
@@ -93,7 +93,7 @@ namespace VeraCrypt
void Show (HWND parent) const
{
char szErrCode[16];
- StringCbPrintfA (szErrCode, sizeof(szErrCode), "0x%.8X", LastError);
+ StringCchPrintfA (szErrCode, ARRAYSIZE(szErrCode), "0x%.8X", LastError);
string msgBody = "Windows Crypto API failed.\n\n\n(If you report a bug in connection with this, please include the following technical information in the bug report:\n" + string (SrcPos) + "\nLast Error = " + string (szErrCode) + ")";
MessageBoxA (parent, msgBody.c_str(), "VeraCrypt", MB_ICONERROR | MB_SETFOREGROUND);
}