aboutsummaryrefslogtreecommitdiff
path: root/gas/listing.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2001-09-25 12:09:45 +0000
committerAlan Modra <amodra@gmail.com>2001-09-25 12:09:45 +0000
commit97735a42e734bf25da3ae7e0a0068a91699cf186 (patch)
tree3c31680064064df8f20087be35ba43a476cdf6cd /gas/listing.c
parent86ed34a90291bea9c1e93a9454e1535378437bdd (diff)
downloadgdb-97735a42e734bf25da3ae7e0a0068a91699cf186.zip
gdb-97735a42e734bf25da3ae7e0a0068a91699cf186.tar.gz
gdb-97735a42e734bf25da3ae7e0a0068a91699cf186.tar.bz2
* 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.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gas/listing.c b/gas/listing.c
index f8847d9..c92f2db 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;