Skip to content

Commit

Permalink
Another optimization in runtime speed by spending less calls to check…
Browse files Browse the repository at this point in the history
…Ustar()
  • Loading branch information
venerjoel99 committed Aug 17, 2017
1 parent 0ceed38 commit 94d6a17
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions TarCleaner/TarCleaner.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ int cleanAndCopy(const char* fileName, const char* copyFileName){
int j;
for (j = 0; j < size; j++){
if ((j % 1000000)==0) printf("%i MB\n", j / 1000000);
if (checkUstar(j)!=0) continue;
header h = parseHeader(j - USTAR_INDEX);
if (checkUstar(j + USTAR_INDEX)!=0) continue;
header h = parseHeader(j);
int end = h.headerIndex + BLOCKSIZE + h.bufferSize;
if (leaking(h.headerIndex, size)==true){
printf("%i Leaked file: %s\n", h.headerIndex, h.fileName);
Expand Down
6 changes: 5 additions & 1 deletion TarCleaner/TarCleaner.depend
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@
"TarCleaner.h"
<stdio.h>

1502936364 source:c:\users\84ven\desktop\tar\tarcleaner\main.c
1502939852 source:c:\users\84ven\desktop\tar\tarcleaner\main.c
"TarCleaner.h"

1502936364 c:\users\84ven\desktop\tar\tarcleaner\tarcleaner.h
<stdio.h>

1502940675 source:c:\users\84ven\desktop\tar\tarcleaner\tarcleaner.c
"TarCleaner.h"
<stdio.h>

Binary file modified TarCleaner/bin/Debug/TarCleaner.exe
Binary file not shown.
Binary file modified TarCleaner/bin/Release/TarCleaner.exe
Binary file not shown.
2 changes: 0 additions & 2 deletions TarCleaner/main.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#include "TarCleaner.h"



int main(){
char file1[100];
char file2[100];
Expand Down
Binary file modified TarCleaner/obj/Debug/TarCleaner.o
Binary file not shown.
Binary file modified TarCleaner/obj/Debug/main.o
Binary file not shown.
Binary file modified TarCleaner/obj/Release/TarCleaner.o
Binary file not shown.

0 comments on commit 94d6a17

Please sign in to comment.