mirror of
https://github.com/fluencelabs/wasmer
synced 2024-12-13 06:15:33 +00:00
fix(runtime-c-api) wasmer_last_error_message
returns the length + 1.
Returning the error message's length + 1 mimics the `wasmer_last_error_length` function that counts the trailing null byte.
This commit is contained in:
parent
1d555301f7
commit
7d2721ef7a
@ -85,7 +85,7 @@ pub unsafe extern "C" fn wasmer_last_error_message(buffer: *mut c_char, length:
|
||||
// accidentally read into garbage.
|
||||
buffer[error_message.len()] = 0;
|
||||
|
||||
error_message.len() as c_int
|
||||
error_message.len() as c_int + 1
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
|
Loading…
Reference in New Issue
Block a user