diff options
-rw-r--r-- | winsup/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/testsuite/winsup.api/ltp/dup03.c | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/winsup/testsuite/ChangeLog b/winsup/testsuite/ChangeLog index be6c82c..66944c0 100644 --- a/winsup/testsuite/ChangeLog +++ b/winsup/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2005-12-11 Christopher Faylor <cgf@timesys.com> + + * winsup.api/ltp/dup03.c (cleanup): Fix longstanding off-by-one error + when setting array element to -1. + 2005-06-11 Christopher Faylor <cgf@timesys.com> * winsup.api/pthread/cancel2.c: Use explicit initializer for mutex. diff --git a/winsup/testsuite/winsup.api/ltp/dup03.c b/winsup/testsuite/winsup.api/ltp/dup03.c index bcc347a..dc2efbb 100644 --- a/winsup/testsuite/winsup.api/ltp/dup03.c +++ b/winsup/testsuite/winsup.api/ltp/dup03.c @@ -271,8 +271,8 @@ cleanup() /* close the open file we've been dup'ing */ if (Fd) { - for (; Nfds >0 ; Nfds--) { - if (close(Fd[Nfds-1]) == -1) { + while (Nfds-- >0) { + if (close(Fd[Nfds]) == -1) { tst_resm(TWARN, "close(%s) Failed, errno=%d : %s", Fname, errno, strerror(errno)); } |