🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Raymond L. Toy Wed, 26 Aug 1992 08:31
Indent 1.6: bug in reading stdin
#634
Author: Raymond L. Toy
Date: Wed, 26 Aug 1992 08:31
28 lines
1238 bytes
In indent 1.6, there is a stupid bug that causes the
input to be overwritten.  It's caused by not resetting the
input pointer when the buffer has been realloc'ed to a new
place.  The patch is a simple two-line addition to update
the input pointer after realloc'ing the input buffer.
Patch follows.

Ray
----------
Ray -----> toy@soho.crd.ge.com
Toy -----> KWC407, x6270

---------------Cut here------------
*** io.c~       Fri Aug 14 19:09:17 1992
--- io.c        Wed Aug 26 12:26:00 1992
***************
*** 502,509 ****
--- 502,511 ----

        if (ch != EOF)
        {
+         int offset = p - stdinptr.data;
          size += (2 * BUFSIZ);
          stdinptr.data = xrealloc (stdinptr.data, size);
+         p = stdinptr.data + offset;
        }
      }
    while (ch != EOF);
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads