]> code.delx.au - gnu-emacs/commitdiff
* nsterm.m (ns_select): Check writefds before call to
authorJan Djärv <jan.h.d@swipnet.se>
Thu, 18 Oct 2012 18:54:37 +0000 (20:54 +0200)
committerJan Djärv <jan.h.d@swipnet.se>
Thu, 18 Oct 2012 18:54:37 +0000 (20:54 +0200)
FD_ISSET.

Fixes: debbugs:12668
src/ChangeLog
src/nsterm.m

index 6fece1e72c57c7c5ec6ef250d5168bdb7adcc028..f1e3a99dbc658079b66f9859b0d6adcd2fc16b68 100644 (file)
@@ -1,3 +1,8 @@
+2012-10-18  Jan Djärv  <jan.h.d@swipnet.se>
+
+       * nsterm.m (ns_select): Check writefds before call to
+       FD_ISSET (Bug#12668).
+
 2012-10-18  Daniel Colascione  <dancol@dancol.org>
 
        * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
index dfc84db50f7e9fab223f02f1b415a3076d984e6f..a4eaad47ac1286b1e38f934279eeac835438d669 100644 (file)
@@ -3443,10 +3443,10 @@ ns_select (int nfds, fd_set *readfds, fd_set *writefds,
 
 /*  NSTRACE (ns_select); */
 
-  for (k = 0; readfds && k < nfds+1; k++)
+  for (k = 0; k < nfds+1; k++)
     {
-      if (FD_ISSET(k, readfds)) ++nr;
-      if (FD_ISSET(k, writefds)) ++nr;
+      if (readfds && FD_ISSET(k, readfds)) ++nr;
+      if (writefds && FD_ISSET(k, writefds)) ++nr;
     }
 
   if (NSApp == nil