VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Core/Unix
diff options
context:
space:
mode:
authorkovalev0 <107109684+kovalev0@users.noreply.github.com>2023-10-08 16:36:15 +0300
committerGitHub <noreply@github.com>2023-10-08 15:36:15 +0200
commit847abb23f03ca911bd9ed7dbdef97ac2c5469145 (patch)
tree66a25d681b56ce62185cd925b9a055d89f9b3388 /src/Core/Unix
parentc91e5792ef7361a06ed959b47cbe97da97e7a037 (diff)
downloadVeraCrypt-847abb23f03ca911bd9ed7dbdef97ac2c5469145.tar.gz
VeraCrypt-847abb23f03ca911bd9ed7dbdef97ac2c5469145.zip
Fix warnings and throwing an exception instead of ignoring the error (#1229)
* EMVCard.cpp: ArrayToHexWideString: prohibit conversion of a string constant ../Common/EMVCard.cpp: In function 'std::wstring VeraCrypt::ArrayToHexWideString(con st unsigned char*, size_t)': ../Common/EMVCard.cpp:28:43: warning: ISO C++ forbids converting a string constant to 'wchar_t*' [-Wwrite-strings] 28 | static wchar_t* hexChar = L"0123456789ABCDEF"; | ^~~~~~~~~~~~~~~~~~~ Signed-off-by: Vasiliy Kovalev <kovalev@altlinux.org> * EMVCard.cpp: ArrayToHexWideString: fix of the comparison of different types ../Common/EMVCard.cpp: In function 'std::wstring VeraCrypt::ArrayToHexWideString(con st unsigned char*, size_t)': ../Common/EMVCard.cpp:32:43: warning: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Wsign-compare] 32 | for (int i = 0; i < cbData; i++) | ~~^~~~~~~~ Signed-off-by: Vasiliy Kovalev <kovalev@altlinux.org> * SecurityTokenKeyfilesDialog.cpp: removed initialization of an unused variable Forms/SecurityTokenKeyfilesDialog.cpp:58:24: warning: unused variable 'i' [-Wunused- variable] 58 | size_t i = 0; | ^ Signed-off-by: Vasiliy Kovalev <kovalev@altlinux.org> * Core/Unix: throwing an exception instead of ignoring the error Fixes: 5a6b445f ("fix warnings and UB (#1164)") Signed-off-by: Vasiliy Kovalev <kovalev@altlinux.org> --------- Signed-off-by: Vasiliy Kovalev <kovalev@altlinux.org> Co-authored-by: Vasiliy Kovalev <kovalev@altlinux.org>
Diffstat (limited to 'src/Core/Unix')
-rw-r--r--src/Core/Unix/CoreUnix.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/Core/Unix/CoreUnix.cpp b/src/Core/Unix/CoreUnix.cpp
index 0b248fb9..258979b9 100644
--- a/src/Core/Unix/CoreUnix.cpp
+++ b/src/Core/Unix/CoreUnix.cpp
@@ -22,9 +22,6 @@
#include "Driver/Fuse/FuseService.h"
#include "Volume/VolumePasswordCache.h"
-template<typename T>
-inline void ignore_result(const T & /* unused result */) {}
-
namespace VeraCrypt
{
#ifdef TC_LINUX
@@ -694,7 +691,7 @@ namespace VeraCrypt
{
try
{
- ignore_result(chown (mountPoint.c_str(), GetRealUserId(), GetRealGroupId()));
+ throw_sys_sub_if (chown (mountPoint.c_str(), GetRealUserId(), GetRealGroupId()) == -1, mountPoint);
} catch (...) { }
}
}