diff --git a/sk1/main.c b/sk1/main.c index 07720c5..dfcbc43 100644 --- a/sk1/main.c +++ b/sk1/main.c @@ -13,21 +13,21 @@ void print_help() { } int main(int argc, char* argv[]) { - int result = 1; + int res = 1; if (argc < 2) { fprintf(stderr, "Chyba: Chybaju argumenty. Pouzite -h pre zobrazenie pomoci.\n"); - result = 0; + res = 0; } if (strcmp(argv[1], "-h") == 0) { print_help(); - result = 0; + res = 0; } if ((strcmp(argv[1], "-c") == 0 || strcmp(argv[1], "-d") == 0 || strcmp(argv[1], "-c2") == 0 || strcmp(argv[1], "-d2") == 0) && argc != 4) { fprintf(stderr, "Chyba: Nespravny pocet argumentov. Pouzite -h pre zobrazenie pomoci.\n"); - result = 0; + res = 0; } const char* input_file = argv[2]; @@ -38,29 +38,29 @@ int main(int argc, char* argv[]) { result = compress_1(input_file, output_file); if (result < 0) { fprintf(stderr, "Chyba: Kompresia zlyhala.\n"); - result = 0; + res = 0; } } else if (strcmp(argv[1], "-d") == 0) { result = decompress_1(input_file, output_file); if (result < 0) { fprintf(stderr, "Chyba: Dekompresia zlyhala.\n"); - result = 0; + res = 0; } } else if (strcmp(argv[1], "-c2") == 0) { result = compress_2(input_file, output_file); if (result < 0) { fprintf(stderr, "Chyba: Kompresia zlyhala.\n"); - result = 0; + res = 0; } } else if (strcmp(argv[1], "-d2") == 0) { result = decompress_2(input_file, output_file); if (result < 0) { fprintf(stderr, "Chyba: Dekompresia zlyhala.\n"); - result = 0; + res = 0; } } else { fprintf(stderr, "Chyba: Neznámy argument. Použite -h pre zobrazenie pomoci.\n"); - result = 0; + res = 0; } return result;