* listing.c (buffer_line): Don't write past the end of `line' when
authorAlan Modra <amodra@gmail.com>
Tue, 25 Sep 2001 12:09:45 +0000 (12:09 +0000)
committerAlan Modra <amodra@gmail.com>
Tue, 25 Sep 2001 12:09:45 +0000 (12:09 +0000)
EOF is reached.

gas/ChangeLog
gas/listing.c

index eb9f1f8..3d3000d 100644 (file)
@@ -1,3 +1,8 @@
+2001-09-25  Geoff Berry  <geoff.berry@bops.com>
+
+       * listing.c (buffer_line): Don't write past the end of `line' when
+       EOF is reached.
+
 2001-09-25  Alexandre Oliva  <aoliva@redhat.com>
 
        * config/tc-mn10300.c (tc_gen_reloc): Don't emit an *ABS*
index f8847d9..c92f2db 100644 (file)
@@ -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;