@@ -1124,26 +1124,24 @@ void read_parameter_list_decl(func_t *func, bool anon)
11241124
11251125void read_literal_param (block_t * parent , basic_block_t * bb )
11261126{
1127- char literal [MAX_TOKEN_LEN ];
1128- char unescaped [MAX_TOKEN_LEN ];
1129- char combined [MAX_TOKEN_LEN ];
1127+ char literal [MAX_TOKEN_LEN ], unescaped [MAX_TOKEN_LEN ],
1128+ combined [MAX_LINE_LEN ];
11301129 int combined_len = 0 ;
11311130
11321131 /* Read first string literal */
11331132 lex_ident (T_string , literal );
1134- unescape_string (literal , unescaped , MAX_TOKEN_LEN );
1135- strcpy (combined , unescaped );
1136- combined_len = strlen (unescaped );
1133+ unescape_string (literal , combined , MAX_LINE_LEN );
1134+ combined_len = strlen (combined );
11371135
11381136 /* Check for adjacent string literals and concatenate them */
11391137 while (lex_peek (T_string , NULL )) {
11401138 lex_ident (T_string , literal );
1141- unescape_string (literal , unescaped , MAX_TOKEN_LEN );
1139+ unescape_string (literal , unescaped , MAX_LINE_LEN - combined_len );
11421140 int unescaped_len = strlen (unescaped );
1143- if (combined_len + unescaped_len >= MAX_TOKEN_LEN - 1 )
1141+ if (combined_len + unescaped_len >= MAX_LINE_LEN - 1 )
11441142 error ("Concatenated string literal too long" );
11451143
1146- strcpy (combined + combined_len , literal );
1144+ strcpy (combined + combined_len , unescaped );
11471145 combined_len += unescaped_len ;
11481146 }
11491147
0 commit comments