mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-11 14:37:32 +08:00
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
@ -1,3 +1,8 @@
|
|||||||
|
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)
|
|||||||
}
|
}
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user