浏览代码

Use a null-terminated string for the file name

Lucas Stadler 10 年之前
父节点
当前提交
a15fe17b56
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      rust/coffi/src/main.rs

+ 1 - 1
rust/coffi/src/main.rs

@ -43,7 +43,7 @@ fn main() {
43 43
    unsafe {
44 44
        let mut img: png_image = std::mem::zeroed();
45 45
        print_img(&img);
46
        let res = png_image_begin_read_from_file(&mut img, "mei.png".as_ptr());
46
        let res = png_image_begin_read_from_file(&mut img, "mei.png\0".as_ptr());
47 47
        println!("read_from_file: {}", res);
48 48
        print_img(&img);
49 49
    }