Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
raviqqe committed Oct 18, 2023
1 parent 2de7997 commit 47441b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion melior/src/string_ref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl<'c> StringRef<'c> {
pub fn from_c_str(string: &'c CStr) -> Self {
let string = MlirStringRef {
data: string.as_ptr(),
length: string.to_bytes_with_nul().len(),
length: string.to_bytes_with_nul().len() - 1,
};

unsafe { Self::from_raw(string) }
Expand Down

0 comments on commit 47441b0

Please sign in to comment.