From 46bcbf8ce072770ea32f97a32debb20cee76e0b2 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 7 Dec 2005 18:11:10 +0000 Subject: [PATCH] * fhandler_floppy.cc (fhandler_dev_floppy::lseek): Fix test for valid file position at EOM. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/fhandler_floppy.cc | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 0979b803b..d6f56576d 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2005-12-07 Corinna Vinschen + + * fhandler_floppy.cc (fhandler_dev_floppy::lseek): Fix test for + valid file position at EOM. + 2005-12-07 Christopher Faylor * include/cygwin/stdlib.h: Guard compilation of *unsetenv* in newlib. diff --git a/winsup/cygwin/fhandler_floppy.cc b/winsup/cygwin/fhandler_floppy.cc index 84d3d0f88..3bc9f5191 100644 --- a/winsup/cygwin/fhandler_floppy.cc +++ b/winsup/cygwin/fhandler_floppy.cc @@ -380,7 +380,7 @@ fhandler_dev_floppy::lseek (_off64_t offset, int whence) whence = SEEK_SET; } - if (whence != SEEK_SET || lloffset < 0 || lloffset >= drive_size) + if (whence != SEEK_SET || lloffset < 0 || lloffset > drive_size) { set_errno (EINVAL); return -1; -- 2.43.5