summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-02-04 19:06:54 -0500
committerJune McEnroe <june@causal.agency>2020-02-04 19:06:54 -0500
commitf3fb466a31d78431a686981b7d9b718385591bce (patch)
treeeeaac9ef363fa585c7d574ec70eb9ae36fc7fa06
parentHandle signals in poll loop (diff)
downloadcatgirl-f3fb466a31d78431a686981b7d9b718385591bce.tar.gz
catgirl-f3fb466a31d78431a686981b7d9b718385591bce.zip
Only check revents if nfds > 0
If an error occurs, poll leaves the array unmodified.
-rw-r--r--chat.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/chat.c b/chat.c
index 3aa4ad2..1656a53 100644
--- a/chat.c
+++ b/chat.c
@@ -125,11 +125,11 @@ int main(int argc, char *argv[]) {
 		if (signals[SIGWINCH]) {
 			signals[SIGWINCH] = 0;
 			cursesWinch(SIGWINCH);
-			fds[0].revents = POLLIN;
+			uiRead();
 		}
 
-		if (fds[0].revents) uiRead();
-		if (fds[1].revents) ircRecv();
+		if (nfds > 0 && fds[0].revents) uiRead();
+		if (nfds > 0 && fds[1].revents) ircRecv();
 		uiDraw();
 	}
 
/src/commit/www/photo.causal.agency/2024-09-15/lens?id=1a4a0628513359733a2450cf38e73166f7e5cbe6&follow=1'>Add photos from September 15June McEnroe 2024-09-24Add photos from September 14June McEnroe 2024-09-24Add photos from September 12June McEnroe 2024-09-24Add photos from September 7June McEnroe 2024-09-24Allow not having descriptionsJune McEnroe 2024-09-23Automatically select the last used lens for a bodyJune McEnroe 2024-09-19Add photos from September 5June McEnroe 2024-09-15Add some more film stocks to the listJune McEnroe 2024-09-13Add photos from September 2June McEnroe 2024-09-13Add Fomapan 200 to films listJune McEnroe 2024-09-10Add August 29 picnic photosJune McEnroe 2024-09-08Apply some bold to trips renderingJune McEnroe 2024-09-08Render trips hopefully more efficientlyJune McEnroe 2024-09-08Allow removing bodies and lensesJune McEnroe 2024-09-08Limit body width so it looks less silly on desktopJune McEnroe 2024-09-07Handle no film being loadedJune McEnroe 2024-09-07Fancy up the text a littleJune McEnroe