summaryrefslogtreecommitdiffstats
path: root/libjava/java/nio/channels/FileChannelImpl.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/java/nio/channels/FileChannelImpl.java')
-rw-r--r--libjava/java/nio/channels/FileChannelImpl.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/libjava/java/nio/channels/FileChannelImpl.java b/libjava/java/nio/channels/FileChannelImpl.java
index a14a7e1dd43..89ac11ad514 100644
--- a/libjava/java/nio/channels/FileChannelImpl.java
+++ b/libjava/java/nio/channels/FileChannelImpl.java
@@ -169,7 +169,9 @@ public class FileChannelImpl extends FileChannel
byte[] buffer = new byte [dst.remaining ()];
result = implRead (buffer, 0, buffer.length);
- dst.put (buffer, 0, result);
+
+ if (result > 0)
+ dst.put (buffer, 0, result);
return result;
}
OpenPOWER on IntegriCloud