aboutsummaryrefslogtreecommitdiff
path: root/bfd/bfd.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2024-02-12 14:25:03 -0700
committerTom Tromey <tom@tromey.com>2024-02-12 16:25:37 -0700
commit91095bcf2820f3d77ea1e16a338e686ba6a70e9f (patch)
tree41ee18a16ef5c433c58f63d686a8006b86aed6c9 /bfd/bfd.c
parente25a613437218e60854241e95e8028343a983d92 (diff)
downloadgdb-91095bcf2820f3d77ea1e16a338e686ba6a70e9f.zip
gdb-91095bcf2820f3d77ea1e16a338e686ba6a70e9f.tar.gz
gdb-91095bcf2820f3d77ea1e16a338e686ba6a70e9f.tar.bz2
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.
Diffstat (limited to 'bfd/bfd.c')
-rw-r--r--bfd/bfd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bfd/bfd.c b/bfd/bfd.c
index 0776145..6c60227 100644
--- a/bfd/bfd.c
+++ b/bfd/bfd.c
@@ -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;
}