shithub: femtolisp

Download patch

ref: 3f23591b324cee2aff71267745dc699cd6567948
parent: f4ac95ac1ac2169be77bb140732f8d1c978d076d
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Tue Dec 24 12:21:02 EST 2024

io-filename: can't return a static string - it might get freed

--- a/iostream.c
+++ b/iostream.c
@@ -344,7 +344,7 @@
 BUILTIN("io-filename", io_filename)
 {
 	argcount(nargs, 1);
-	return cvalue_static_cstring(toiostream(args[0])->loc.filename);
+	return string_from_cstr(toiostream(args[0])->loc.filename);
 }
 
 BUILTIN("io-line", io_line)