fix(c-api) Fix how string's length is computed.

Obviously, it's just `feature.size`. Why did I do that…?
This commit is contained in:
Ivan Enderlin
2021-02-05 10:09:43 +01:00
parent 8b2c3852b6
commit f85ebe1b21

View File

@@ -300,7 +300,7 @@ pub unsafe extern "C" fn wasm_cpu_features_add(
let feature = c_try!(
str::from_utf8(slice::from_raw_parts(
feature.data,
feature.size + 1,
feature.size,
));
otherwise false
);