]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
revert until sure of suitability
authorsopwith <sopwith>
Tue, 3 Apr 2001 21:40:27 +0000 (21:40 +0000)
committersopwith <sopwith>
Tue, 3 Apr 2001 21:40:27 +0000 (21:40 +0000)
form.c

diff --git a/form.c b/form.c
index 2d95d2aefa783d0adfafd67ec31e779ee34b09c9..952f879475642478e553f4043336d36ed007f160 100644 (file)
--- a/form.c
+++ b/form.c
@@ -1115,17 +1115,10 @@ void newtFormSetBackground(newtComponent co, int color) {
 
 void newtFormWatchFd(newtComponent co, int fd, int fdFlags) {
     struct form * form = co->data;
-    int i;
-
-    for (i = 0; i < form->numFds; i++)
-      if (form->fds[i].fd == fd)
-       break;
-
-    if(i >= form->numFds)
-      form->fds = realloc(form->fds, (++form->numFds) * sizeof(*form->fds));
 
-    form->fds[i].fd = fd;
-    form->fds[i].flags = fdFlags;
+    form->fds = realloc(form->fds, (form->numFds + 1) * sizeof(*form->fds));
+    form->fds[form->numFds].fd = fd;
+    form->fds[form->numFds++].flags = fdFlags;
     if (form->maxFd < fd) form->maxFd = fd;
 }