widl: Avoid using sprintf() to add a single character.

This commit is contained in:
Huw Davies 2024-08-30 20:41:43 +01:00 committed by Alexandre Julliard
parent f4c993c06e
commit af3f67a5f4
Notes: Alexandre Julliard 2024-09-06 22:38:19 +02:00
Approved-by: Rémi Bernon (@rbernon)
Approved-by: Elizabeth Figura (@zfigura)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/wine/merge_requests/6417

View file

@ -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 );
}