Commit cfa82f4d by Tom Tromey Committed by Tom Tromey

* gnu/gcj/convert/natIconv.cc (init): Terminate buffer.

From-SVN: r36733
parent 61a77fea
2000-10-05 Tom Tromey <tromey@cygnus.com>
* gnu/gcj/convert/natIconv.cc (init): Terminate buffer.
2000-10-02 Bryce McKinlay <bryce@albatross.co.nz>
* prims.cc (_Jv_argv, _Jv_argc): New fields.
......
......@@ -38,8 +38,9 @@ gnu::gcj::convert::Input_iconv::init (jstring encoding)
{
#ifdef HAVE_ICONV
jsize len = _Jv_GetStringUTFLength (encoding);
char buffer[len];
char buffer[len + 1];
_Jv_GetStringUTFRegion (encoding, 0, len, buffer);
buffer[len] = '\0';
iconv_t h = iconv_open ("UCS-2", buffer);
if (h == (iconv_t) -1)
......@@ -97,8 +98,9 @@ gnu::gcj::convert::Output_iconv::init (jstring encoding)
{
#ifdef HAVE_ICONV
jsize len = _Jv_GetStringUTFLength (encoding);
char buffer[len];
char buffer[len + 1];
_Jv_GetStringUTFRegion (encoding, 0, len, buffer);
buffer[len] = '\0';
iconv_t h = iconv_open (buffer, "UCS-2");
if (h == (iconv_t) -1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment