From: sopwith Date: Tue, 3 Apr 2001 21:40:27 +0000 (+0000) Subject: revert until sure of suitability X-Git-Tag: r0-50-24~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b94ecd1d4de2ce27084ae88b007c6299986029bd;p=thirdparty%2Fnewt.git revert until sure of suitability --- 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; }