Skip to content

Commit 425923b

Browse files
committed
Don't assume that c_char is u8
1 parent 276dc78 commit 425923b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/fonts.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,15 @@ impl Pattern {
6767
}
6868
}
6969
pub fn get_file_name(&self) -> &str {
70-
let name = b"file\0";
70+
let name = CString::new("file").unwrap();
7171
unsafe {
7272
let mut file_name = ptr::null();
7373
FcPatternGetString(self.pattern, name.as_ptr(), 0, &mut file_name);
7474
CStr::from_ptr(file_name).to_str().unwrap()
7575
}
7676
}
7777
pub fn get_font_index(&self) -> isize {
78-
let name = b"index\0";
78+
let name = CString::new("index").unwrap();
7979
unsafe {
8080
let mut index = 0;
8181
FcPatternGetInteger(self.pattern, name.as_ptr(), 0, &mut index);

0 commit comments

Comments
 (0)