@@ -, +, @@ PR binutils/18750 * ihex.c (ihex_bad_byte): Fix incorrect escape sequence (and stack overflow) on platforms with signed char. * srec.c (srec_bad_byte): Ditto. --- bfd/ihex.c | 2 +- bfd/srec.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) --- a/bfd/ihex.c +++ a/bfd/ihex.c @@ -220,7 +220,7 @@ ihex_bad_byte (bfd *abfd, unsigned int lineno, int c, bfd_boolean error) char buf[10]; if (! ISPRINT (c)) - sprintf (buf, "\\%03o", (unsigned int) c); + sprintf (buf, "\\%03o", (unsigned int) (c & 0xff)); else { buf[0] = c; --- a/bfd/srec.c +++ a/bfd/srec.c @@ -251,7 +251,7 @@ srec_bad_byte (bfd *abfd, char buf[10]; if (! ISPRINT (c)) - sprintf (buf, "\\%03o", (unsigned int) c); + sprintf (buf, "\\%03o", (unsigned int) (c & 0xff)); else { buf[0] = c; --