Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use truncation on file create to avoid leaving trailing garbage #22

Merged
merged 1 commit into from Feb 2, 2014
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Use truncation on file create to avoid leaving trailing garbage

  • Loading branch information
larsbergstrom committed Feb 2, 2014
commit b915eccd738d979a4f39cb5734a32327d4c177df
2 lib.rs
@@ -178,7 +178,7 @@ pub extern fn flush_data(png_ptr: *ffi::png_struct) {
}

pub fn store_png(img: &Image, path: &Path) -> Result<(),~str> {
let mut file = match File::open_mode(path, io::Open, io::Write) {
let mut file = match File::create(path) {
Some(file) => file,
None => return Err(~"could not open file")
};
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.