mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-10 01:29:05 -04:00
rust: proper subslice in ncplane_putstr()
This commit is contained in:
parent
a23efbb463
commit
63f65a0902
@ -13,7 +13,7 @@ pub fn ncplane_putstr_yx(_n: *mut ffi::ncplane, mut _y: i32, mut _x: i32, _str:
|
||||
while ret < _str.len() {
|
||||
let mut wcs = 0;
|
||||
unsafe {
|
||||
let col = ffi::ncplane_putegc_yx(_n, -1, -1, std::ffi::CString::new(_str).expect("Bad string").as_ptr(), &mut wcs);
|
||||
let col = ffi::ncplane_putegc_yx(_n, -1, -1, std::ffi::CString::new(&_str[ret..]).expect("Bad string").as_ptr(), &mut wcs);
|
||||
if col < 0 {
|
||||
return ret; // FIXME return error result
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user