From 0121f47e00e44a40a41d7b49852129b12f5e1d43 Mon Sep 17 00:00:00 2001 From: "yann.collet.73@gmail.com" Date: Fri, 27 May 2011 12:18:22 +0000 Subject: [PATCH] Corrected : demo program : "/" no longer a valid option trigger, in order to allow absolute path on *nix systems. Changed (minor) : demo program : differentiate error numbers between compression et decoding routines. git-svn-id: https://lz4.googlecode.com/svn/trunk@8 650e7d94-2a16-8b24-b05c-7c0b3f6821cd --- main.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/main.c b/main.c index dd39444..cf94577 100644 --- a/main.c +++ b/main.c @@ -88,7 +88,6 @@ int badusage() { printf("Wrong parameters\n"); usage(); - printf(" --- type any key to exit ---\n"); return 0; } @@ -151,8 +150,8 @@ int decode_file(char* input_filename, char* output_filename) FILE* foutput = fopen( output_filename, "wb" ); size_t uselessRet; - if (finput==0 ) { printf("Pb opening %s\n", input_filename); return 2; } - if (foutput==0) { printf("Pb opening %s\n", output_filename); return 3; } + if (finput==0 ) { printf("Pb opening %s\n", input_filename); return 4; } + if (foutput==0) { printf("Pb opening %s\n", output_filename); return 5; } // Allocate Memory in_buff = malloc(OUT_CHUNKSIZE); @@ -160,7 +159,7 @@ int decode_file(char* input_filename, char* output_filename) // Check Archive Header uselessRet = fread(out_buff, 1, ARCHIVE_MAGICNUMBER_SIZE, finput); - if (*(U32*)out_buff != ARCHIVE_MAGICNUMBER) { printf("Wrong file : cannot be decoded\n"); return 4; } + if (*(U32*)out_buff != ARCHIVE_MAGICNUMBER) { printf("Wrong file : cannot be decoded\n"); return 6; } // Main Loop while (1) @@ -201,7 +200,6 @@ int main(int argc, char** argv) // Welcome message printf(WELCOME_MESSAGE); - //printf("Nb argument = %i \n", argc); if (argc<2) { badusage(); return 1; } for(i=1; i