From: Iain Patterson Date: Wed, 1 Jan 2014 23:23:48 +0000 (+0000) Subject: ANSI compiler food. X-Git-Tag: v2.22~85 X-Git-Url: http://git.iain.cx/?a=commitdiff_plain;h=10eb89c84baf36bbb77f6aaf497dcd6f74644bc3;p=nssm.git ANSI compiler food. --- 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);