mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-27 15:41: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:
@ -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)]
|
||||
|
Reference in New Issue
Block a user