projects
/
emacs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f80eb0d
)
* src/nsterm.m (ns_select): Fix off-by-one error, and add assertion
author
Philipp Stephani
<phst@google.com>
Wed, 30 Dec 2020 21:17:52 +0000
(22:17 +0100)
committer
Philipp Stephani
<phst@google.com>
Wed, 30 Dec 2020 21:36:42 +0000
(22:36 +0100)
src/nsterm.m
patch
|
blob
|
history
diff --git
a/src/nsterm.m
b/src/nsterm.m
index 161677484f95ffbe793682525946146ac07ee873..1a23fc6912ccac2e02721df028fba5dd5ebc52d8 100644
(file)
--- a/
src/nsterm.m
+++ b/
src/nsterm.m
@@
-4697,7
+4697,8
@@
ns_select (int nfds, fd_set *readfds, fd_set *writefds,
return -1;
}
- for (k = 0; k < nfds+1; k++)
+ eassert (nfds <= FD_SETSIZE);
+ for (k = 0; k < nfds; k++)
{
if (readfds && FD_ISSET(k, readfds)) ++nr;
if (writefds && FD_ISSET(k, writefds)) ++nr;