From 10eb89c84baf36bbb77f6aaf497dcd6f74644bc3 Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Wed, 1 Jan 2014 23:23:48 +0000 Subject: [PATCH] ANSI compiler food. --- service.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service.cpp b/service.cpp index eaeb797..4ec5133 100644 --- a/service.cpp +++ b/service.cpp @@ -286,7 +286,7 @@ int grant_logon_as_service(const TCHAR *username) { #else size_t buflen; mbstowcs_s(&buflen, NULL, 0, username, _TRUNCATE); - lsa_username.MaximumLength = buflen * sizeof(wchar_t); + lsa_username.MaximumLength = (unsigned short) buflen * sizeof(wchar_t); lsa_username.Length = lsa_username.MaximumLength - sizeof(wchar_t); lsa_username.Buffer = (wchar_t *) HeapAlloc(GetProcessHeap(), 0, lsa_username.MaximumLength); if (lsa_username.Buffer) mbstowcs_s(&buflen, lsa_username.Buffer, lsa_username.MaximumLength, username, _TRUNCATE); -- 2.20.1