]> source.dussan.org Git - poi.git/commitdiff
Bug 17890: Corrected exception text for zero byte file.
authorJason Height <jheight@apache.org>
Tue, 25 Jul 2006 12:19:31 +0000 (12:19 +0000)
committerJason Height <jheight@apache.org>
Tue, 25 Jul 2006 12:19:31 +0000 (12:19 +0000)
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@425384 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/poifs/storage/HeaderBlockReader.java
src/java/org/apache/poi/poifs/storage/RawDataBlock.java

index 6a600a91fcb599caa1e60c154bdb02ef0f90f4d2..0dcc768ab4284b2267a465330bfca21a7e617558 100644 (file)
@@ -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"));
 
index 29770c8b65bfa8ed1b420692f4da73413635fec1..3a80e51e2883a0965d561b0157472194795f3ef8 100644 (file)
@@ -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"));