From: Hans Leidekker hans@codeweavers.com
Like midl does. --- tools/widl/parser.l | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/tools/widl/parser.l b/tools/widl/parser.l index 9ff4e7b01f6..c57ad990c5b 100644 --- a/tools/widl/parser.l +++ b/tools/widl/parser.l @@ -136,7 +136,10 @@ static int token_uuid( const char *str, YYSTYPE *yylval )
static int token_str( int token, const char *str, YYSTYPE *yylval ) { - char *tmp = xstrdup( str ); + int len = strlen( str ); + char *tmp = xmalloc( len + 1 ); + + strcpy( tmp, str );
if (token == aWSTRING || token == aSTRING || token == aSQSTRING) { @@ -149,6 +152,14 @@ static int token_str( int token, const char *str, YYSTYPE *yylval ) } dst[-1] = 0; /* strip last quote */ } + else if (token == aIDENTIFIER) + { + if (len > 255) + { + warning( "truncating identifier that exceeds 255 character limit\n" ); + tmp[255] = 0; + } + }
yylval->str = tmp; return token;