X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=lib-lib%2Ffile.c;h=584fcdbb69286d0589dbdd1781b9c8993bc10e21;hb=7e6ea12f3d017b6a04d86862e42ef3fd23780d8e;hp=de3c75b0288b8e6cf10b9582e944a88479366b82;hpb=92f2fc3802e13a8eb0717123c588d855fa0de67f;p=apps%2Fmadmutt.git diff --git a/lib-lib/file.c b/lib-lib/file.c index de3c75b..584fcdb 100644 --- a/lib-lib/file.c +++ b/lib-lib/file.c @@ -200,7 +200,7 @@ void mutt_unlink(const char *s) fwrite(buf, 1, MIN(ssizeof(buf), sb.st_size), f); sb.st_size -= MIN(ssizeof(buf), sb.st_size); } - fclose (f); + m_fclose(&f); } } } @@ -232,16 +232,6 @@ FILE *safe_fopen(const char *path, const char *mode) return fopen(path, mode); } -int safe_fclose(FILE **f) -{ - int r = 0; - - if (*f) - r = fclose (*f); - *f = NULL; - return r; -} - /* If rfc1524_expand_command() is used on a recv'd message, then * the filename doesn't exist yet, but if its used while sending a message, * then we need to rename the existing file. @@ -268,13 +258,13 @@ int mutt_rename_file(char *oldfile, char *newfile) nfp = safe_fopen(newfile, "w"); if (!nfp) { - fclose (ofp); + m_fclose(&ofp); return 3; } mutt_copy_stream(ofp, nfp); - fclose(nfp); - fclose(ofp); + m_fclose(&nfp); + m_fclose(&ofp); mutt_unlink(oldfile); return 0; }