Mercurial > hg > early-roguelike
diff arogue7/save.c @ 203:aa8e1fc62926
Advanced Rogue 7: add and use more md_ functions.
md_fileno() and md_fdopen() are now included. I still hope to rewrite
everything to use FILE *'s.
author | John "Elwin" Edwards |
---|---|
date | Thu, 13 Aug 2015 07:38:57 -0400 |
parents | 82b2a046d151 |
children | f9ef86cf22b2 |
line wrap: on
line diff
--- a/arogue7/save.c Wed Aug 12 17:03:15 2015 -0400 +++ b/arogue7/save.c Thu Aug 13 07:38:57 2015 -0400 @@ -111,7 +111,7 @@ */ if (save_file(savefd) == FALSE) { msg("Cannot create save file."); - unlink(file_name); + md_unlink(file_name); return(FALSE); } else return(TRUE); @@ -160,7 +160,7 @@ num_written = ENCWRITE(version, num_to_write, savefd); sprintf(prbuf,"%d x %d\n", LINES, COLS); ENCWRITE(prbuf,80,savefd); - savef = (FILE *) fdopen(savefd,"wb"); + savef = (FILE *) md_fdopen(savefd,"wb"); ret = rs_save_file(savef); fclose(savef); if (num_to_write == num_written && ret == 0) return(TRUE);