From 9c6417ea88a71691f41a519713975219ca2596b3 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 24 Apr 2015 10:59:01 +0200 Subject: [PATCH] terminal: printf() is not signal-safe We shouldn't call it from a signal handler. --- osdep/terminal-unix.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/osdep/terminal-unix.c b/osdep/terminal-unix.c index d0f40f3a4c..f43376b088 100644 --- a/osdep/terminal-unix.c +++ b/osdep/terminal-unix.c @@ -275,8 +275,7 @@ static void enable_kx(bool enable) // shouldn't be relied on here either. if (isatty(STDOUT_FILENO)) { char *cmd = enable ? "\033=" : "\033>"; - printf("%s", cmd); - fflush(stdout); + write(STDOUT_FILENO, cmd, strlen(cmd)); } }