VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/Dlgcode.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Common/Dlgcode.c')
-rw-r--r--src/Common/Dlgcode.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Common/Dlgcode.c b/src/Common/Dlgcode.c
index df5d6355..2cf61415 100644
--- a/src/Common/Dlgcode.c
+++ b/src/Common/Dlgcode.c
@@ -1584,11 +1584,11 @@ void LowerCaseCopy (wchar_t *lpszDest, const wchar_t *lpszSource)
void UpperCaseCopy (wchar_t *lpszDest, size_t cbDest, const wchar_t *lpszSource)
{
- if (lpszDest && cbDest)
+ if (lpszDest && (cbDest >= 2))
{
size_t i = wcslen (lpszSource);
- if (i >= cbDest)
- i = cbDest - 1;
+ if (i >= (cbDest/2))
+ i = (cbDest/2) - 1;
lpszDest[i] = 0;
i++;