terminate zero-length char array with null char in stringUTFChars

This commit is contained in:
Joel Dice 2012-08-04 12:36:18 -06:00
parent ebd7f69c41
commit 248ff91d74

View File

@ -3667,7 +3667,6 @@ stringUTFChars(Thread* t, object string, unsigned start, unsigned length,
assert(t, static_cast<unsigned>
(stringUTFLength(t, string, start, length)) == charsLength);
if (length) {
object data = stringData(t, string);
if (objectClass(t, data) == type(t, Machine::ByteArrayType)) {
memcpy(chars,
@ -3694,7 +3693,6 @@ stringUTFChars(Thread* t, object string, unsigned start, unsigned length,
}
chars[j] = 0;
}
}
}
uint64_t