[PATCH 0/1] MR6417: widl: Avoid using sprintf() to add a single character.
From: Huw Davies <huw(a)codeweavers.com> --- tools/widl/parser.l | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/widl/parser.l b/tools/widl/parser.l index 87a9fc55f07..9ff4e7b01f6 100644 --- a/tools/widl/parser.l +++ b/tools/widl/parser.l @@ -619,9 +619,10 @@ static void diagnostic( const struct location *where, const char *type, const ch fprintf( stderr, "%s", line ); line = buffer; - for (i = 0; i < where->first_column - 1; i++) line += sprintf( line, " " ); - line += sprintf( line, "^" ); - for (i = where->first_column + 1; i < where->last_column; i++) line += sprintf( line, "~" ); + for (i = 0; i < where->first_column - 1; i++) *line++ = ' '; + *line++ = '^'; + for (i = where->first_column + 1; i < where->last_column; i++) *line++ = '~'; + *line = '\0'; fprintf( stderr, "%s\n", buffer ); } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/6417
This merge request was approved by Elizabeth Figura. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6417
This merge request was approved by Rémi Bernon. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6417
participants (4)
-
Elizabeth Figura (@zfigura) -
Huw Davies -
Huw Davies (@huw) -
Rémi Bernon