From b94ecd1d4de2ce27084ae88b007c6299986029bd Mon Sep 17 00:00:00 2001 From: sopwith Date: Tue, 3 Apr 2001 21:40:27 +0000 Subject: [PATCH] revert until sure of suitability --- form.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/form.c b/form.c index 2d95d2a..952f879 100644 --- 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; } -- 2.47.2