Browse Source

Windows needs remove before rename

Czajkowski, Piotr 5 years ago
parent
commit
4e181234f0
1 changed files with 2 additions and 0 deletions
  1. 2 0
      zip.c

+ 2 - 0
zip.c

@@ -67,6 +67,7 @@ int anonymize(const char *infile, char *outfile) {
 
 		const char *outfile = "tmpFile.docx";
 		processDOCX(infile, outfile);
+		remove(infile);
 		rename(outfile, infile);
 	} else {
 		strcat(binnFile, outfile);
@@ -84,6 +85,7 @@ int deanonymize(const char *infile, char *outfile) {
 	if (!outfile || strcmp(infile, outfile) == 0){
 		const char *outfile = "tmpFile.docx";
 		processDOCX(infile, outfile);
+		remove(infile);
 		rename(outfile, infile);
 	} else {
 		processDOCX(infile, outfile);