Commit 47e26109 by Tom Tromey Committed by Tom Tromey

natString.cc (getBytes): Correctly size result buffer.

	* java/lang/natString.cc (getBytes): Correctly size result
	buffer.  From Bryce McKinlay <bryce@albatross.co.nz>.

From-SVN: r26575
parent 11bbe619
1999-04-21 Tom Tromey <tromey@cygnus.com>
* java/lang/natString.cc (getBytes): Correctly size result
buffer. From Bryce McKinlay <bryce@albatross.co.nz>.
1999-04-20 Andrew Haley <aph@cygnus.com> 1999-04-20 Andrew Haley <aph@cygnus.com>
* include/sparc-signal.h: new file. * include/sparc-signal.h: new file.
......
...@@ -487,8 +487,8 @@ java::lang::String::getBytes (jstring enc) ...@@ -487,8 +487,8 @@ java::lang::String::getBytes (jstring enc)
} }
if (bufpos == buflen) if (bufpos == buflen)
return buffer; return buffer;
jbyteArray result = JvNewByteArray(bufpos); jbyteArray result = JvNewByteArray(buflen);
memcpy (elements (result), elements (buffer), bufpos); memcpy (elements (result), elements (buffer), buflen);
return result; return result;
} }
......
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