From: Alan Modra Date: Tue, 25 Sep 2001 12:09:45 +0000 (+0000) Subject: * listing.c (buffer_line): Don't write past the end of `line' when X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=97735a42e734bf25da3ae7e0a0068a91699cf186;p=binutils-gdb.git * listing.c (buffer_line): Don't write past the end of `line' when EOF is reached. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index eb9f1f8bedb..3d3000d1219 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2001-09-25 Geoff Berry + + * listing.c (buffer_line): Don't write past the end of `line' when + EOF is reached. + 2001-09-25 Alexandre Oliva * config/tc-mn10300.c (tc_gen_reloc): Don't emit an *ABS* diff --git a/gas/listing.c b/gas/listing.c index f8847d9a207..c92f2db11c3 100644 --- a/gas/listing.c +++ b/gas/listing.c @@ -513,9 +513,12 @@ buffer_line (file, line, size) if (c == EOF) { file->at_end = 1; - *p++ = '.'; - *p++ = '.'; - *p++ = '.'; + if (count + 2 < size) + { + *p++ = '.'; + *p++ = '.'; + *p++ = '.'; + } } file->linenum++; *p++ = 0;