chiark / gitweb /
Fix overflow in dstr_putline.
authormdw <mdw>
Wed, 22 Dec 1999 15:39:28 +0000 (15:39 +0000)
committermdw <mdw>
Wed, 22 Dec 1999 15:39:28 +0000 (15:39 +0000)
dstr.c

diff --git a/dstr.c b/dstr.c
index d15fba8355780f1f54cb3aa82cacdc2f17a6bc5d..4df8f7238a4d8ea3e2c127e00787dca78280d946 100644 (file)
--- a/dstr.c
+++ b/dstr.c
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: dstr.c,v 1.12 1999/12/10 23:42:04 mdw Exp $
+ * $Id: dstr.c,v 1.13 1999/12/22 15:39:28 mdw Exp $
  *
  * Handle dynamically growing strings
  *
@@ -30,6 +30,9 @@
 /*----- Revision history --------------------------------------------------*
  *
  * $Log: dstr.c,v $
+ * Revision 1.13  1999/12/22 15:39:28  mdw
+ * Fix overflow in dstr_putline.
+ *
  * Revision 1.12  1999/12/10 23:42:04  mdw
  * Change header file guard names.
  *
@@ -273,6 +276,7 @@ int dstr_putline(dstr *d, FILE *fp)
     /* --- Make sure there's some buffer space --- */
 
     if (!left) {
+      d->len = off;
       dstr_ensure(d, 1);
       left = d->sz - off;
     }