ANSI compiler food.
authorIain Patterson <me@iain.cx>
Wed, 1 Jan 2014 23:23:48 +0000 (23:23 +0000)
committerIain Patterson <me@iain.cx>
Wed, 1 Jan 2014 23:40:28 +0000 (23:40 +0000)
service.cpp

index eaeb797..4ec5133 100644 (file)
@@ -286,7 +286,7 @@ int grant_logon_as_service(const TCHAR *username) {
 #else\r
   size_t buflen;\r
   mbstowcs_s(&buflen, NULL, 0, username, _TRUNCATE);\r
-  lsa_username.MaximumLength = buflen * sizeof(wchar_t);\r
+  lsa_username.MaximumLength = (unsigned short) buflen * sizeof(wchar_t);\r
   lsa_username.Length = lsa_username.MaximumLength - sizeof(wchar_t);\r
   lsa_username.Buffer = (wchar_t *) HeapAlloc(GetProcessHeap(), 0, lsa_username.MaximumLength);\r
   if (lsa_username.Buffer) mbstowcs_s(&buflen, lsa_username.Buffer, lsa_username.MaximumLength, username, _TRUNCATE);\r