diff options
author | green <green@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-01-31 08:56:09 +0000 |
---|---|---|
committer | green <green@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-01-31 08:56:09 +0000 |
commit | 8eeb67a6d1ad7c926ff572207f9c6e3e4b42059e (patch) | |
tree | 0f3ed1e1568d3f064c4b84ca0b491b4dcc001b25 /libjava/gnu | |
parent | 7d845f5615b4e374d233b99f498113cf66cafaf4 (diff) | |
download | gcc-8eeb67a6d1ad7c926ff572207f9c6e3e4b42059e.tar.gz |
* gnu/gcj/convert/natIconv.cc (read): Minor fixes.
(write): Ditto.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@31712 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/gnu')
-rw-r--r-- | libjava/gnu/gcj/convert/natIconv.cc | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/libjava/gnu/gcj/convert/natIconv.cc b/libjava/gnu/gcj/convert/natIconv.cc index 129db7ecf05..ee3490a99b7 100644 --- a/libjava/gnu/gcj/convert/natIconv.cc +++ b/libjava/gnu/gcj/convert/natIconv.cc @@ -69,9 +69,12 @@ gnu::gcj::convert::Input_iconv::read (jcharArray outbuffer, size_t outavail = count; size_t old_out = outavail; + const char *inbuf = (const char *) &bytes[inpos]; + char *outbuf = (char *) &out[outpos]; + size_t r = iconv ((iconv_t) handle, - &bytes[inpos], &inavail, - &out[outpos], &outavail); + &inbuf, &inavail, + &outbuf, &outavail); // FIXME: what if R==-1? inpos += old_in - inavail; @@ -118,7 +121,7 @@ gnu::gcj::convert::Output_iconv::write (jcharArray inbuffer, jint inpos, jint count) { #ifdef HAVE_ICONV - jint origpos = outpos; + jint origpos = inpos; jchar *chars = elements (inbuffer); jbyte *out = elements (buf); @@ -129,9 +132,12 @@ gnu::gcj::convert::Output_iconv::write (jcharArray inbuffer, size_t outavail = buf->length - count; size_t old_out = outavail; + const char *inbuf = (const char *) &chars[inpos]; + char *outbuf = (char *) &out[count]; + size_t r = iconv ((iconv_t) handle, - &chars[inpos], &inavail, - &out[count], &outavail); + &inbuf, &inavail, + &outbuf, &outavail); // FIXME: what if R==-1? count += old_out - outavail; |