widl: Pass the right size to MIDL_memset in generated proxy code
Dan Hipschman
dsh at linux.ucla.edu
Mon Aug 14 18:45:56 CDT 2006
When calling memset, pass the size of the pointed to object, not
the size of the pointer.
ChangeLog:
* Pass the correct size to memset in generated proxy file
---
tools/widl/proxy.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/tools/widl/proxy.c b/tools/widl/proxy.c
index 9bba5c5..3d3e717 100644
--- a/tools/widl/proxy.c
+++ b/tools/widl/proxy.c
@@ -172,10 +172,8 @@ static void clear_output_vars( var_t *ar
if (is_attr(arg->attrs, ATTR_OUT) && !is_attr(arg->attrs, ATTR_IN)) {
print_proxy( "if(%s)\n", arg->name );
indent++;
- print_proxy( "MIDL_memset( %s, 0, sizeof( ", arg->name );
+ print_proxy( "MIDL_memset( %s, 0, sizeof( *%s ));\n", arg->name, arg->name );
indent--;
- write_type(proxy, arg->type, arg, arg->tname);
- fprintf( proxy, " ));\n" );
}
arg = PREV_LINK(arg);
}
More information about the wine-patches
mailing list