mirror of
https://github.com/danog/ext-php-rs.git
synced 2024-11-30 04:39:04 +01:00
Fixed ZendString
missing one character (#82)
This commit is contained in:
parent
aed061d7be
commit
a404df8fed
@ -2,8 +2,10 @@
|
||||
|
||||
- `PhpException` no longer requires a lifetime [#80].
|
||||
- Added `PhpException` and `PhpResult` to prelude [#80].
|
||||
- Fixed `ZendString` missing last character [#82].
|
||||
|
||||
[#80]: https://github.com/davidcole1340/ext-php-rs/pull/80
|
||||
[#82]: https://github.com/davidcole1340/ext-php-rs/pull/82
|
||||
|
||||
## Version 0.5.0
|
||||
|
||||
|
@ -54,7 +54,7 @@ impl ZendStr {
|
||||
pub fn as_c_str(&self) -> &CStr {
|
||||
// SAFETY: Zend strings store their readable length in a fat pointer.
|
||||
unsafe {
|
||||
let slice = slice::from_raw_parts(self.val.as_ptr() as *const u8, self.len());
|
||||
let slice = slice::from_raw_parts(self.val.as_ptr() as *const u8, self.len() + 1);
|
||||
CStr::from_bytes_with_nul_unchecked(slice)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user