From 8edab16f7a56c8e822f94609b69c4f95ee2eec3b Mon Sep 17 00:00:00 2001 From: Philipp Takacs Date: Sat, 21 Feb 2015 11:03:26 +0100 Subject: [PATCH] remove longjmp from signalhandler in getans To avoid undefined behavior use close in the signal handler. --- sbr/getans.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sbr/getans.c b/sbr/getans.c index 7254d6b..f3cea27 100644 --- a/sbr/getans.c +++ b/sbr/getans.c @@ -10,6 +10,7 @@ #include #include #include +#include static char ansbuf[BUFSIZ]; static jmp_buf sigenv; @@ -72,5 +73,5 @@ intrser(int i) /* ** should this be siglongjmp? */ - longjmp(sigenv, 1); + close(STDIN_FILENO); } -- 1.7.10.4