I need an advice

Jeff Sturm jsturm@one-point.com
Fri Aug 17 12:20:00 GMT 2001


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.


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /