propsys: Don't use the format string size as buffer size.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2017-08-28 18:15:12 +02:00
parent feac70c1cf
commit 7960ed9d42
1 changed files with 2 additions and 8 deletions

View File

@ -49,22 +49,16 @@ static HRESULT PROPVAR_ConvertFILETIME(const FILETIME *ft, PROPVARIANT *ppropvar
switch (vt)
{
case VT_LPSTR:
{
static const char format[] = "%04d/%02d/%02d:%02d:%02d:%02d.%03d";
ppropvarDest->u.pszVal = HeapAlloc(GetProcessHeap(), 0,
sizeof(format));
ppropvarDest->u.pszVal = HeapAlloc(GetProcessHeap(), 0, 64);
if (!ppropvarDest->u.pszVal)
return E_OUTOFMEMORY;
snprintf( ppropvarDest->u.pszVal, sizeof(format),
format,
sprintf( ppropvarDest->u.pszVal, "%04d/%02d/%02d:%02d:%02d:%02d.%03d",
time.wYear, time.wMonth, time.wDay,
time.wHour, time.wMinute, time.wSecond,
time.wMilliseconds );
return S_OK;
}
default:
FIXME("Unhandled target type: %d\n", vt);