Skip to content

Commit

Permalink
Merge #2097
Browse files Browse the repository at this point in the history
2097: fix(c-api) Fix how string's length is computed r=Hywan a=Hywan

# Description

Obviously, it's just `feature.size`. Why did I do that…?

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Ivan Enderlin <ivan@mnt.io>
  • Loading branch information
bors[bot] and Hywan authored Feb 5, 2021
2 parents 8b2c385 + 14e1d75 commit 3477e52
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
### Changed

### Fixed
- [#2097](https://github.com/wasmerio/wasmer/pull/2097) Fix how string's length is computed in `wasm_cpu_features_add` in the C API.

## 1.0.2 - 2021-02-04

Expand Down
2 changes: 1 addition & 1 deletion lib/c-api/src/wasm_c_api/unstable/target_lexicon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
Expand Down

0 comments on commit 3477e52

Please sign in to comment.