diff options
author | Jari Vetoniemi <mailroxas@gmail.com> | 2018-02-19 02:19:22 +0200 |
---|---|---|
committer | Jari Vetoniemi <mailroxas@gmail.com> | 2018-02-19 02:19:22 +0200 |
commit | 00a623e565cb60feee124394f18b32cfee3c6386 (patch) | |
tree | 9e7da7117aab8af483d2bd8710bae751464fea76 | |
parent | 5bdbb44a50c653a6f324d6d2355bca60e203fad0 (diff) |
jvm: always null terminate strings
-rw-r--r-- | src/fakejvm/jvm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/fakejvm/jvm.c b/src/fakejvm/jvm.c index f71412f..baf097c 100644 --- a/src/fakejvm/jvm.c +++ b/src/fakejvm/jvm.c @@ -35,7 +35,7 @@ jvm_string_set_cstr_with_length(struct jvm_string *string, const char *data, con assert(string); char *copy = (char*)data; - if (heap && data && len > 0 && !(copy = ccopy(data, len, data[len] != 0))) + if (heap && data && len > 0 && !(copy = ccopy(data, len, true))) return false; jvm_string_release(string); |