* gnu/gcj/convert/natIconv.cc (iconv_init): Pad in[] with NUL byte.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@175266
138bc75d-0d04-0410-961f-
82ee72b054a4
+2011-06-21 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ PR libgcj/49314
+ * gnu/gcj/convert/natIconv.cc (iconv_init): Pad in[] with NUL byte.
+
2011-06-17 Jack Howarth <howarth@bromo.med.uc.edu>
PR target/49461
2011-06-17 Jack Howarth <howarth@bromo.med.uc.edu>
PR target/49461
// natIconv.cc -- Java side of iconv() reader.
// natIconv.cc -- Java side of iconv() reader.
-/* Copyright (C) 2000, 2001, 2003, 2006 Free Software Foundation
+/* Copyright (C) 2000, 2001, 2003, 2006, 2011 Free Software Foundation
This file is part of libgcj.
This file is part of libgcj.
if (handle != (iconv_t) -1)
{
jchar c;
if (handle != (iconv_t) -1)
{
jchar c;
char *inp, *outp;
size_t inc, outc, r;
char *inp, *outp;
size_t inc, outc, r;
- // This is the UTF-8 encoding of \ufeff.
+ // This is the UTF-8 encoding of \ufeff. At least Tru64 UNIX libiconv
+ // needs the trailing NUL byte, otherwise iconv fails with EINVAL.
in[0] = 0xef;
in[1] = 0xbb;
in[2] = 0xbf;
in[0] = 0xef;
in[1] = 0xbb;
in[2] = 0xbf;
outp = (char *) &c;
outc = 2;
outp = (char *) &c;
outc = 2;