kaffe.io.ByteToCharIconv makes wrong results
Ito Kazumitsu
ito.kazumitsu at hitachi-cable.co.jp
Fri Jan 18 16:12:18 PST 2002
In message "Re: kaffe.io.ByteToCharIconv makes wrong results"
on 01/12/20, Ito Kazumitsu <ito.kazumitsu at hitachi-cable.co.jp> writes:
> In message "kaffe.io.ByteToCharIconv makes wrong results"
> on 01/09/03, Ito Kazumitsu <ito.kazumitsu at hitachi-cable.co.jp> writes:
>
> > kaffe.io.ByteToCharIconv seems to make wrong results.
>
> Soon after I posted this bug report, I personally received a patch
> from Edouard G. Parmelan. But I am afraid this fix has not been
> committed in the CVS yet.
>
> Should I post Edouard's patch for him?
Now I think I should post this patch.
Index: ByteToCharIconv.c
===================================================================
RCS file: /cvs/kaffe/kaffe/libraries/clib/native/ByteToCharIconv.c,v
retrieving revision 1.1
diff -u -u -r1.1 ByteToCharIconv.c
--- ByteToCharIconv.c 2000/11/30 03:42:12 1.1
+++ ByteToCharIconv.c 2001/09/03 08:50:59
@@ -90,7 +90,7 @@
#endif
ret = iconv (cd, &icv_in, &icv_inlen, &icv_out, &icv_outlen);
#ifndef WORDS_BIGENDIAN
- swab (buffer, jc + toPos, toLen - (icv_outlen / 2));
+ swab (buffer, jc + toPos, toLen * 2 - icv_outlen);
KFREE (buffer);
#endif
if (icv_inlen > 0) {
More information about the kaffe
mailing list