Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2005-12-12 01:31:00 +0300
committerChristopher Faylor <me@cgf.cx>2005-12-12 01:31:00 +0300
commit4e8e54543e9e9dc20786e1f554d92186f812517e (patch)
treef7e235b5d484c304e14fc4075b6f4363e4d89d14 /winsup/testsuite/winsup.api/ltp
parent4989ff286d38fb49218afcc1f2a7907788e17477 (diff)
* winsup.api/ltp/dup03.c (cleanup): Fix longstanding off-by-one error when
setting array element to -1.
Diffstat (limited to 'winsup/testsuite/winsup.api/ltp')
-rw-r--r--winsup/testsuite/winsup.api/ltp/dup03.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/winsup/testsuite/winsup.api/ltp/dup03.c b/winsup/testsuite/winsup.api/ltp/dup03.c
index bcc347aac..dc2efbb0a 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));
}