This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: I need an advice




On 17 Aug 2001, Tom Tromey wrote:
> Jeff> -    return write(work, inpos, inlength);
> Jeff> +    return write(work, 0, inlength);
> 
> Shouldn't that be:
> 
>     return write(work, 0, srcEnd - inpos);

I agree.  The following patch survives "make check":

2001-08-17  Jeff Sturm  <jsturm@one-point.com>

	* gnu/gcj/convert/UnicodeToBytes.java (write): Write work buffer
	starting from zero offset.

Index: gnu/gcj/convert/UnicodeToBytes.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/gcj/convert/UnicodeToBytes.java,v
retrieving revision 1.8
diff -u -p -r1.8 UnicodeToBytes.java
--- UnicodeToBytes.java	2001/07/30 20:24:18	1.8
+++ UnicodeToBytes.java	2001/08/17 18:09:39
@@ -143,7 +143,7 @@ public abstract class UnicodeToBytes ext
       work = new char[inlength];
     int srcEnd = inpos + (inlength > work.length ? work.length : inlength);
     str.getChars(inpos, srcEnd, work, 0);
-    return write(work, inpos, inlength);
+    return write(work, 0, srcEnd - inpos);
   }
 
   /** Indicate that the converter is resuable.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]