Do not call fputc from _bfd_doprnt

I noticed that _bfd_doprnt can unconditionally call fputc.  However,
when called from error_handler_sprintf, this will likely result in a
crash, as the stream argument does not actually point to a FILE.

	* bfd.c (_bfd_doprnt): Do not call fputc.
This commit is contained in:
Tom Tromey 2024-02-12 14:25:03 -07:00
parent e25a613437
commit 91095bcf28

View File

@ -1027,7 +1027,7 @@ _bfd_doprnt (print_func print, void *stream, const char *format,
}
else if (ptr[1] == '%')
{
fputc ('%', stream);
print (stream, "%%");
result = 1;
ptr += 2;
}