From 487673099762aef3a981351f9e26dcf823f03f56 Mon Sep 17 00:00:00 2001 From: jerome ibanes Date: Tue, 18 Nov 2025 14:20:09 -0800 Subject: [PATCH] Update a.c t could be equal to zero, fclose(0) -> SIGSEGV --- a.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/a.c b/a.c index 6116692..d45c45c 100644 --- a/a.c +++ b/a.c @@ -160,6 +160,7 @@ int main(int c,char**v){u r=2==c; //!< entry point: r=0 is rep x(e(l), //!< else, evaluate buffer b[] and put result into x, then: 58==l[1]?x //!< if b starts with a global assignment e.g. a:7, suppress output and cycle repl. :_x(W(x)));} //!< otherwise, pretty print evaluation result to stdout, then cycle repl. - R free(l),fclose(t),0;} //!< in c, return value of main() is the exit code of the process, 0 is success. + if(t)fclose(t); + R free(l),0;} //!< in c, return value of main() is the exit code of the process, 0 is success. //:~