diff options
author | Alan Modra <amodra@bigpond.net.au> | 2001-09-25 12:09:45 +0000 |
---|---|---|
committer | Alan Modra <amodra@bigpond.net.au> | 2001-09-25 12:09:45 +0000 |
commit | c7640a668c3eb84e663bd96a55c9a2180a11044c (patch) | |
tree | 2806cef304434cb7ea7a4b2c76fc8dc1e80ea84c /gas/listing.c | |
parent | 74a1e66191ba31d0f1af2419ccce0f33a8cb061d (diff) | |
download | binutils-redhat-c7640a668c3eb84e663bd96a55c9a2180a11044c.tar.gz |
* listing.c (buffer_line): Don't write past the end of `line' when
EOF is reached.
Diffstat (limited to 'gas/listing.c')
-rw-r--r-- | gas/listing.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gas/listing.c b/gas/listing.c index f8847d9a20..c92f2db11c 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; |