summaryrefslogtreecommitdiff
path: root/win
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@montyprogram.com>2012-04-16 23:31:33 +0200
committerVladislav Vaintroub <wlad@montyprogram.com>2012-04-16 23:31:33 +0200
commit5af60b5ed433b023852653e2cd0af3303453c602 (patch)
treea2c94b9bd168141b5355ac6facc03c8a6273d043 /win
parent85f7acf631f85b699752e4e9bf2c10b5edfcde5c (diff)
downloadmariadb-git-5af60b5ed433b023852653e2cd0af3303453c602.tar.gz
fix compiler warnings
Diffstat (limited to 'win')
-rw-r--r--win/packaging/ca/CustomAction.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/win/packaging/ca/CustomAction.cpp b/win/packaging/ca/CustomAction.cpp
index e943d1a58b8..dbce86804c8 100644
--- a/win/packaging/ca/CustomAction.cpp
+++ b/win/packaging/ca/CustomAction.cpp
@@ -80,7 +80,7 @@ LExit:
It is assumed that called will add double quotation marks before and after
the string.
*/
-static void EscapeCommandLine(const wchar_t *in, wchar_t *out)
+static void EscapeCommandLine(const wchar_t *in, wchar_t *out, size_t buflen)
{
const wchar_t special_chars[]=L" \t\n\v\"";
bool needs_escaping= false;
@@ -97,7 +97,7 @@ static void EscapeCommandLine(const wchar_t *in, wchar_t *out)
if(!needs_escaping)
{
- wcscpy(out, in);
+ wcscpy_s(out, buflen, in);
return;
}
@@ -119,7 +119,7 @@ static void EscapeCommandLine(const wchar_t *in, wchar_t *out)
Escape all backslashes, but let the terminating double quotation mark
that caller adds be interpreted as a metacharacter.
*/
- for(int j= 0; j < 2*n_backslashes;j++)
+ for(size_t j= 0; j < 2*n_backslashes;j++)
{
out[pos++]=L'\\';
}
@@ -130,7 +130,7 @@ static void EscapeCommandLine(const wchar_t *in, wchar_t *out)
/*
Escape all backslashes and the following double quotation mark.
*/
- for(int j= 0; j < 2*n_backslashes + 1; j++)
+ for(size_t j= 0; j < 2*n_backslashes + 1; j++)
{
out[pos++]=L'\\';
}
@@ -139,7 +139,7 @@ static void EscapeCommandLine(const wchar_t *in, wchar_t *out)
else
{
/* Backslashes aren't special here. */
- for (int j=0; j < n_backslashes; j++)
+ for (size_t j=0; j < n_backslashes; j++)
out[pos++] = L'\\';
out[pos++]= c;
@@ -592,7 +592,8 @@ extern "C" UINT __stdcall CheckDatabaseProperties (MSIHANDLE hInstall)
DWORD PasswordLen= MAX_PATH;
MsiGetPropertyW (hInstall, L"PASSWORD", Password, &PasswordLen);
- EscapeCommandLine(Password, EscapedPassword);
+ EscapeCommandLine(Password, EscapedPassword,
+ sizeof(EscapedPassword)/sizeof(EscapedPassword[0]));
MsiSetPropertyW(hInstall,L"ESCAPEDPASSWORD",EscapedPassword);
DWORD SkipNetworkingLen= MAX_PATH;