From 5964d1ac87bf72cd3a36118e3c5262a4a2e59789 Mon Sep 17 00:00:00 2001 From: Holger Zickner Date: Mon, 6 Dec 2004 13:47:02 +0000 Subject: bugfix: wrong length calculation --- src/jake2/util/Lib.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/jake2/util/Lib.java b/src/jake2/util/Lib.java index 1393e67..8abad61 100644 --- a/src/jake2/util/Lib.java +++ b/src/jake2/util/Lib.java @@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // Created on 09.12.2003 by RST. -// $Id: Lib.java,v 1.9 2004-11-07 19:30:12 cawe Exp $ +// $Id: Lib.java,v 1.10 2004-12-06 13:47:02 hzi Exp $ package jake2.util; @@ -270,7 +270,7 @@ public class Lib { public static String CtoJava(byte[] old, int offset, int maxLenght) { int i; - for (i = offset; old[i] != 0 && i < maxLenght; i++); + for (i = offset; old[i] != 0 && (i - offset) < maxLenght; i++); return new String(old, offset, i - offset); } -- cgit v1.2.3