msi: Remove an extraneous safety check and simplify deformat_string().

This commit is contained in:
Gerald Pfeifer 2008-01-01 18:18:51 +01:00 committed by Alexandre Julliard
parent e169bb0a7f
commit 739152ce3e
1 changed files with 9 additions and 11 deletions

View File

@ -368,18 +368,16 @@ DWORD deformat_string(MSIPACKAGE *package, LPCWSTR ptr, WCHAR** data )
MSI_RecordSetStringW(rec,0,ptr);
MSI_FormatRecordW(package,rec,NULL,&size);
if (size >= 0)
{
size++;
*data = msi_alloc(size*sizeof(WCHAR));
if (size > 1)
MSI_FormatRecordW(package,rec,*data,&size);
else
*data[0] = 0;
msiobj_release( &rec->hdr );
return sizeof(WCHAR)*size;
}
size++;
*data = msi_alloc(size*sizeof(WCHAR));
if (size > 1)
MSI_FormatRecordW(package,rec,*data,&size);
else
*data[0] = 0;
msiobj_release( &rec->hdr );
return sizeof(WCHAR)*size;
}
*data = NULL;