widl: Use strmake in get_name.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2019-11-08 20:01:43 +01:00 committed by Alexandre Julliard
parent d5c745e467
commit c15f83a2a3
1 changed files with 9 additions and 11 deletions

View File

@ -180,18 +180,16 @@ static void write_namespace_end(FILE *header, struct namespace *namespace)
const char *get_name(const var_t *v) const char *get_name(const var_t *v)
{ {
static char buffer[256]; static char *buffer;
free( buffer );
if (is_attr( v->attrs, ATTR_PROPGET )) if (is_attr( v->attrs, ATTR_PROPGET ))
strcpy( buffer, "get_" ); return buffer = strmake( "get_%s", v->name );
else if (is_attr( v->attrs, ATTR_PROPPUT )) if (is_attr( v->attrs, ATTR_PROPPUT ))
strcpy( buffer, "put_" ); return buffer = strmake( "put_%s", v->name );
else if (is_attr( v->attrs, ATTR_PROPPUTREF )) if (is_attr( v->attrs, ATTR_PROPPUTREF ))
strcpy( buffer, "putref_" ); return buffer = strmake( "putref_%s", v->name );
else buffer = NULL;
buffer[0] = 0; return v->name;
strcat( buffer, v->name );
return buffer;
} }
static void write_fields(FILE *h, var_list_t *fields) static void write_fields(FILE *h, var_list_t *fields)