aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPhilipp Stephani2020-12-30 22:17:52 +0100
committerPhilipp Stephani2020-12-30 22:36:42 +0100
commit72dc46584cec3652c910b7c414e83353a5b536e9 (patch)
tree342ec03b97c3b7ac4cf0eb3036e16fddbcd7e594 /src
parentf80eb0d44800c45b534056ae38401a03bed814bc (diff)
downloademacs-72dc46584cec3652c910b7c414e83353a5b536e9.tar.gz
emacs-72dc46584cec3652c910b7c414e83353a5b536e9.zip
* src/nsterm.m (ns_select): Fix off-by-one error, and add assertion
Diffstat (limited to 'src')
-rw-r--r--src/nsterm.m3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nsterm.m b/src/nsterm.m
index 161677484f9..1a23fc6912c 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -4697,7 +4697,8 @@ ns_select (int nfds, fd_set *readfds, fd_set *writefds,
4697 return -1; 4697 return -1;
4698 } 4698 }
4699 4699
4700 for (k = 0; k < nfds+1; k++) 4700 eassert (nfds <= FD_SETSIZE);
4701 for (k = 0; k < nfds; k++)
4701 { 4702 {
4702 if (readfds && FD_ISSET(k, readfds)) ++nr; 4703 if (readfds && FD_ISSET(k, readfds)) ++nr;
4703 if (writefds && FD_ISSET(k, writefds)) ++nr; 4704 if (writefds && FD_ISSET(k, writefds)) ++nr;