From: Nick Burch Date: Thu, 20 Mar 2008 11:02:39 +0000 (+0000) Subject: Fix for readCompressedUnicode not moaning about length=0, from bug #44643 X-Git-Tag: REL_3_0_3_BETA1~81 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4515943fe83cfc0dea4d7a57668be1d887154991;p=poi.git Fix for readCompressedUnicode not moaning about length=0, from bug #44643 git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@639242 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/poi/hssf/record/RecordInputStream.java b/src/java/org/apache/poi/hssf/record/RecordInputStream.java index 431558ccc8..ba900b2a28 100755 --- a/src/java/org/apache/poi/hssf/record/RecordInputStream.java +++ b/src/java/org/apache/poi/hssf/record/RecordInputStream.java @@ -266,6 +266,9 @@ public class RecordInputStream extends InputStream } public String readCompressedUnicode(int length) { + if(length == 0) { + return ""; + } if ((length < 0) || ((remaining() < length) && !isContinueNext())) { throw new IllegalArgumentException("Illegal length " + length); } @@ -273,7 +276,7 @@ public class RecordInputStream extends InputStream StringBuffer buf = new StringBuffer(length); for (int i=0;i