dlls/msi/helpers.c -- remove two useless checks (and dead code)
Gerald Pfeifer
gerald at pfeifer.com
Wed Jan 2 09:30:45 CST 2008
On Tue, 1 Jan 2008, Gerald Pfeifer wrote:
> Okay, so let me split this patch into two pieces and start with the
> first.
And here is the second part, with the same logic as the previous one:
I traced back the setting of size via MSI_FormatRecordW() and
deformat_string_internal() and in no case do get to -1 or another
negative error marker. Both by type (DWORD) and assignments the
variable "size" is always >= 0, so the check can be omitted.
ChangeLog:
Remove an extraneous safety check and simplify generate_error_string().
Index: dlls/msi/helpers.c
===================================================================
RCS file: /home/wine/wine/dlls/msi/helpers.c,v
retrieving revision 1.72
diff -u -3 -p -r1.72 helpers.c
--- dlls/msi/helpers.c 2 Jan 2008 13:36:26 -0000 1.72
+++ dlls/msi/helpers.c 2 Jan 2008 15:03:57 -0000
@@ -1029,20 +1029,14 @@ WCHAR* generate_error_string(MSIPACKAGE
va_end(va);
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 data;
- }
+ size++;
+ data = msi_alloc(size*sizeof(WCHAR));
+ if (size > 1)
+ MSI_FormatRecordW(package,rec,data,&size);
+ else
+ data[0] = 0;
msiobj_release( &rec->hdr );
- data = NULL;
return data;
}
More information about the wine-patches
mailing list