diff options
Diffstat (limited to 'src/lib/ffi/ffi_util.h')
-rw-r--r-- | src/lib/ffi/ffi_util.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/ffi/ffi_util.h b/src/lib/ffi/ffi_util.h index ae48ab01a..b52c319fe 100644 --- a/src/lib/ffi/ffi_util.h +++ b/src/lib/ffi/ffi_util.h @@ -176,19 +176,20 @@ int write_vec_output(uint8_t out[], size_t* out_len, const std::vector<uint8_t, inline int write_str_output(uint8_t out[], size_t* out_len, const std::string& str) { return write_output(out, out_len, - reinterpret_cast<const uint8_t*>(str.c_str()), + Botan::cast_char_ptr_to_uint8(str.data()), str.size() + 1); } inline int write_str_output(char out[], size_t* out_len, const std::string& str) { - return write_str_output(reinterpret_cast<uint8_t*>(out), out_len, str); + return write_str_output(Botan::cast_char_ptr_to_uint8(out), out_len, str); } inline int write_str_output(char out[], size_t* out_len, const std::vector<uint8_t>& str_vec) { - return write_output(reinterpret_cast<uint8_t*>(out), out_len, - reinterpret_cast<const uint8_t*>(str_vec.data()), + return write_output(Botan::cast_char_ptr_to_uint8(out), + out_len, + str_vec.data(), str_vec.size()); } |