propsys: Use snprintf in PROPVAR_ConvertFILETIME.

Signed-off-by: Gerald Pfeifer <gerald@pfeifer.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Gerald Pfeifer 2017-02-11 23:13:00 +01:00 committed by Alexandre Julliard
parent 68c095302f
commit 6df21d4015
1 changed files with 6 additions and 4 deletions

View File

@ -50,13 +50,15 @@ static HRESULT PROPVAR_ConvertFILETIME(PROPVARIANT *ppropvarDest,
static const char format[] = "%04d/%02d/%02d:%02d:%02d:%02d.%03d";
ppropvarDest->u.pszVal = HeapAlloc(GetProcessHeap(), 0,
lstrlenA(format) + 1);
sizeof(format));
if (!ppropvarDest->u.pszVal)
return E_OUTOFMEMORY;
sprintf(ppropvarDest->u.pszVal, format, time.wYear, time.wMonth,
time.wDay, time.wHour, time.wMinute,
time.wSecond, time.wMilliseconds);
snprintf( ppropvarDest->u.pszVal, sizeof(format),
format,
time.wYear, time.wMonth, time.wDay,
time.wHour, time.wMinute, time.wSecond,
time.wMilliseconds );
return S_OK;
}