X-Git-Url: https://git.llucax.com/z.facultad/75.06/jacu.git/blobdiff_plain/bd0062922151710408edae80d0f67db20114c6c9..83d3320cb8c682ebc17edaae32e555a645424a1b:/src/jacu.c?ds=sidebyside diff --git a/src/jacu.c b/src/jacu.c index ce801b4..4b35832 100644 --- a/src/jacu.c +++ b/src/jacu.c @@ -10,7 +10,7 @@ #include #include -long get_file_size(const char* filename); +long fsize(const char* filename); typedef struct _flags_ { int cflag; @@ -114,12 +114,12 @@ int main(int argc, char* argv[]) return 0; } -long get_file_size(const char* filename) +long fsize(const char* filename) { FILE* file; long file_size; - if (!(file = fopen(filename, "ab"))) return -1; + if (!(file = fopen(filename, "r"))) return -1; file_size = ftell(file); fclose(file); return file_size; @@ -214,7 +214,7 @@ int comprimir(char *src, char *dst, Uint32 pagesize, Uint32 volumesize, t_Flags free(shuff); /* Muestro bpb */ - printf("%s: %.04f bits/byte.\n", dst, get_file_size(dst)*8.0f/get_file_size(src)); + printf("%s: %.04f bits/byte.\n", dst, vfsize(dst)*8.0f/fsize(src)); return 0; } @@ -313,3 +313,4 @@ int descomprimir(char *src, char *dst) free(shuff); return 0; } +