summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2025-05-23 22:06:45 -0700
committerKaz Kylheku <kaz@kylheku.com>2025-05-23 22:06:45 -0700
commit08c4b3cfc799e611350cca32010c281aae9d03f4 (patch)
tree56b3abc77271f20963b29732840a2baa9ebfd969
parent37d391a97d2efc8e3f2e84fe6accd8825faed03e (diff)
downloadtxr-08c4b3cfc799e611350cca32010c281aae9d03f4.tar.gz
txr-08c4b3cfc799e611350cca32010c281aae9d03f4.tar.bz2
txr-08c4b3cfc799e611350cca32010c281aae9d03f4.zip
streams: fix uninitialized last_op in stdio streams.
* stream.c (tail_strategy, make_stdio_stream_common): A recent change introduced this problem. Initialization of h->last_op must no longer be compile-time conditional on CONFIG_STDIO_STRICT, because it is used in non-strict mode also.
-rw-r--r--stream.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/stream.c b/stream.c
index 18b13b3c..e19438d8 100644
--- a/stream.c
+++ b/stream.c
@@ -1268,9 +1268,7 @@ static void tail_strategy(val stream, unsigned long *state)
*/
if (!h->f) {
h->f = newf;
-#if CONFIG_STDIO_STRICT
h->last_op = stdio_none;
-#endif
(void) set_mode_props(m, stream);
break;
}
@@ -1307,9 +1305,7 @@ static void tail_strategy(val stream, unsigned long *state)
fseek(newf, save_pos, SEEK_SET);
fclose(h->f);
h->f = newf;
-#if CONFIG_STDIO_STRICT
h->last_op = stdio_none;
-#endif
(void) set_mode_props(m, stream);
return;
}
@@ -1764,9 +1760,7 @@ static val make_stdio_stream_common(FILE *f, val descr, struct cobj_ops *ops)
h->is_real_time = 0;
#endif
h->is_byte_oriented = 0;
-#if CONFIG_STDIO_STRICT
h->last_op = stdio_none;
-#endif
#if HAVE_SOCKETS
h->family = nil;
h->type = nil;