summaryrefslogtreecommitdiffstats
path: root/src/java
diff options
context:
space:
mode:
authorJason Height <jheight@apache.org>2006-07-25 12:19:31 +0000
committerJason Height <jheight@apache.org>2006-07-25 12:19:31 +0000
commit53b06e968b6f4c6f345974148e1689aac25ce7f5 (patch)
tree1987506f49c6876c0d49d054e8241778aaa899d9 /src/java
parent3499a86c405b169264599344a127cea9321ea9de (diff)
downloadpoi-53b06e968b6f4c6f345974148e1689aac25ce7f5.tar.gz
poi-53b06e968b6f4c6f345974148e1689aac25ce7f5.zip
Bug 17890: Corrected exception text for zero byte file.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@425384 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java')
-rw-r--r--src/java/org/apache/poi/poifs/storage/HeaderBlockReader.java3
-rw-r--r--src/java/org/apache/poi/poifs/storage/RawDataBlock.java4
2 files changed, 7 insertions, 0 deletions
diff --git a/src/java/org/apache/poi/poifs/storage/HeaderBlockReader.java b/src/java/org/apache/poi/poifs/storage/HeaderBlockReader.java
index 6a600a91fc..0dcc768ab4 100644
--- a/src/java/org/apache/poi/poifs/storage/HeaderBlockReader.java
+++ b/src/java/org/apache/poi/poifs/storage/HeaderBlockReader.java
@@ -72,6 +72,9 @@ public class HeaderBlockReader
if (byte_count != POIFSConstants.BIG_BLOCK_SIZE)
{
+ if (byte_count == -1)
+ //Cant have -1 bytes read in the error message!
+ byte_count = 0;
String type = " byte" + ((byte_count == 1) ? ("")
: ("s"));
diff --git a/src/java/org/apache/poi/poifs/storage/RawDataBlock.java b/src/java/org/apache/poi/poifs/storage/RawDataBlock.java
index 29770c8b65..3a80e51e28 100644
--- a/src/java/org/apache/poi/poifs/storage/RawDataBlock.java
+++ b/src/java/org/apache/poi/poifs/storage/RawDataBlock.java
@@ -56,6 +56,10 @@ public class RawDataBlock
}
else if (count != POIFSConstants.BIG_BLOCK_SIZE)
{
+ if (count == -1)
+ //Cant have -1 bytes read in the error message!
+ count = 0;
+
String type = " byte" + ((count == 1) ? ("")
: ("s"));