st
simple terminal
git clone https://9o.is/git/st.git
commit ffe00ce2018ecda3d35679fcff02b4d67b9d7851 parent 82600ae54f16e40e5e8a1f17647074f7e599199f Author: Ivan Delalande <colona@ycc.fr> Date: Fri, 12 Dec 2014 08:39:07 +0100 Fix crash due to invalid timespec given to pselect If blinktimeout is set to a value greater than 1000, pselect will receive a timeout argument with tv_nsec greater than 1E9 (1 sec), and fail, making st crash. This patch just ensures that the timespec structure is correctly filled with a value properly decomposed between tv_sec and tv_nsec. Reported by JasonWoof on IRC. Thanks! Diffstat:
| M | st.c | | | 3 | +++ |
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/st.c b/st.c @@ -3922,6 +3922,9 @@ run(void) { TIMEDIFF(now, lastblink))); } + drawtimeout.tv_sec = \ + drawtimeout.tv_nsec / 1E9; + drawtimeout.tv_nsec %= (long)1E9; } else { tv = NULL; }