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
This commit is contained in:
parent
11bbe619e3
commit
47e2610954
2 changed files with 7 additions and 2 deletions
|
@ -487,8 +487,8 @@ java::lang::String::getBytes (jstring enc)
|
|||
}
|
||||
if (bufpos == buflen)
|
||||
return buffer;
|
||||
jbyteArray result = JvNewByteArray(bufpos);
|
||||
memcpy (elements (result), elements (buffer), bufpos);
|
||||
jbyteArray result = JvNewByteArray(buflen);
|
||||
memcpy (elements (result), elements (buffer), buflen);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue