* java/io/natFileDescriptorWin32.cc (read): Handle case where
count is 0.
* java/io/natFileDescriptorPosix.cc (read): Handle case where
count is 0.
From-SVN: r58997
2002-11-10 Tom Tromey <tromey@redhat.com>
+ * java/io/natFileDescriptorWin32.cc (read): Handle case where
+ count is 0.
+ * java/io/natFileDescriptorPosix.cc (read): Handle case where
+ count is 0.
+
* java/io/Externalizable.java, java/io/FilePermission.java,
java/io/ObjectStreamConstants.java, java/io/Serializable.java,
java/io/SerializablePermission.java, java/text/Format.java,
jsize bsize = JvGetArrayLength (buffer);
if (offset < 0 || count < 0 || offset + count > bsize)
throw new java::lang::ArrayIndexOutOfBoundsException;
+
+ // Must return 0 if an attempt is made to read 0 bytes.
+ if (count == 0)
+ return 0;
+
jbyte *bytes = elements (buffer) + offset;
int r = ::read (fd, bytes, count);
if (r == 0)
if (offset < 0 || count < 0 || offset + count > bsize)
throw new java::lang::ArrayIndexOutOfBoundsException;
+ // Must return 0 if an attempt is made to read 0 bytes.
+ if (count == 0)
+ return 0;
+
jbyte *bytes = elements (buffer) + offset;
DWORD read;