mirror of
https://github.com/corda/corda.git
synced 2025-02-06 02:59:15 +00:00
respect string offset and length when printing exception message
This commit is contained in:
parent
b33f0c311d
commit
051e3bc7a8
@ -3973,8 +3973,13 @@ run(Thread* t)
|
|||||||
(t, className(t, objectClass(exception)), 0));
|
(t, className(t, objectClass(exception)), 0));
|
||||||
|
|
||||||
if (throwableMessage(t, exception)) {
|
if (throwableMessage(t, exception)) {
|
||||||
fprintf(stderr, ": %s\n", &byteArrayBody
|
object m = throwableMessage(t, exception);
|
||||||
(t, stringBytes(t, throwableMessage(t, exception)), 0));
|
char message[stringLength(t, m) + 1];
|
||||||
|
memcpy(message,
|
||||||
|
&byteArrayBody(t, stringBytes(t, m), stringOffset(t, m)),
|
||||||
|
stringLength(t, m));
|
||||||
|
message[stringLength(t, m)] = 0;
|
||||||
|
fprintf(stderr, ": %s\n", message);
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user