summaryrefslogtreecommitdiff
path: root/src/stdio/freopen.c
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2024-02-02 13:56:33 -0500
committerJakob Kaivo <jkk@ung.org>2024-02-02 13:56:33 -0500
commit8b3f2fa09e9241e20926c8171753a271c21ec93d (patch)
treea8bdff34505bfcf999467053dbfbf276bf7233f1 /src/stdio/freopen.c
parent3a9026cf8557c8efec34e652b6bf37ce49f12f86 (diff)
first cut of tracking previous return values with ftell()/fseek() as POC
Diffstat (limited to 'src/stdio/freopen.c')
-rw-r--r--src/stdio/freopen.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/stdio/freopen.c b/src/stdio/freopen.c
index 3a1ef656..d431b0e3 100644
--- a/src/stdio/freopen.c
+++ b/src/stdio/freopen.c
@@ -96,6 +96,12 @@ FILE * freopen(const char * restrict filename, const char * restrict mode, FILE
stream->buf = stream->ibuf;
}
+ free(stream->valid_fpos);
+ stream->nvalid_fpos = 0;
+
+ free(stream->valid_ftell);
+ stream->nvalid_ftell = 0;
+
stream->text = !(strchr(mode, 'b'));
/*