From: rrt Date: Fri, 14 Apr 2000 16:26:53 +0000 (+0000) Subject: [project @ 2000-04-14 16:26:53 by rrt] X-Git-Tag: Approximately_9120_patches~4681 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=881053b6b88d2f1065ce1d5a26d4ee1998ffb1e4;p=ghc-hetmet.git [project @ 2000-04-14 16:26:53 by rrt] Correct an off-by-one error. --- diff --git a/ghc/lib/std/cbits/fileObject.c b/ghc/lib/std/cbits/fileObject.c index 617fca2..bfe279d 100644 --- a/ghc/lib/std/cbits/fileObject.c +++ b/ghc/lib/std/cbits/fileObject.c @@ -1,7 +1,7 @@ /* * (c) The GRASP/AQUA Project, Glasgow University, 1994-1998 * - * $Id: fileObject.c,v 1.9 2000/04/12 17:33:16 simonmar Exp $ + * $Id: fileObject.c,v 1.10 2000/04/14 16:26:53 rrt Exp $ * * hPutStr Runtime Support */ @@ -128,7 +128,7 @@ fill_up_line_buffer(IOFileObject* fo) fo->bufWPtr=0; } ipos = fo->bufWPtr; - len = fo->bufSize - fo->bufWPtr + 1; + len = fo->bufSize - fo->bufWPtr; p = (unsigned char*)fo->buf + fo->bufWPtr; if ((count = diff --git a/ghc/lib/std/cbits/fileObject.h b/ghc/lib/std/cbits/fileObject.h index df97061..def099d 100644 --- a/ghc/lib/std/cbits/fileObject.h +++ b/ghc/lib/std/cbits/fileObject.h @@ -29,7 +29,8 @@ typedef struct _IOFileObject { bufRPtr == -1 => buffer is empty. */ - int bufSize; + int bufSize; /* the size of the buffer, i.e. the number of bytes + malloced */ int flags; struct _IOFileObject* connectedTo;