From: mdw Date: Wed, 22 Dec 1999 15:39:28 +0000 (+0000) Subject: Fix overflow in dstr_putline. X-Git-Tag: 2.0.4~191 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/mLib/commitdiff_plain/9994cbdc1ced4d7c80f490ffb7c536761a5de8a3 Fix overflow in dstr_putline. --- diff --git a/dstr.c b/dstr.c index d15fba8..4df8f72 100644 --- 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; }