This commit is contained in:
Bohdan Kapliuk 2025-01-12 16:21:04 +02:00
parent 6943bad5b4
commit d37589c610

View File

@ -36,26 +36,22 @@ int main(int argc, char* argv[]) {
if (strcmp(argv[1], "-c") == 0) { if (strcmp(argv[1], "-c") == 0) {
result = compress_1(input_file, output_file); result = compress_1(input_file, output_file);
if (result < 0) { if (result < 0) {
fprintf(stderr, "Chyba: Kompresia zlyhala.\n"); return 0;
return 1;
} }
} else if (strcmp(argv[1], "-d") == 0) { } else if (strcmp(argv[1], "-d") == 0) {
result = decompress_1(input_file, output_file); result = decompress_1(input_file, output_file);
if (result < 0) { if (result < 0) {
fprintf(stderr, "Chyba: Dekompresia zlyhala.\n"); return 0;
return 1;
} }
} else if (strcmp(argv[1], "-c2") == 0) { } else if (strcmp(argv[1], "-c2") == 0) {
result = compress_2(input_file, output_file); result = compress_2(input_file, output_file);
if (result < 0) { if (result < 0) {
fprintf(stderr, "Chyba: Kompresia zlyhala.\n"); return 0;
return 1;
} }
} else if (strcmp(argv[1], "-d2") == 0) { } else if (strcmp(argv[1], "-d2") == 0) {
result = decompress_2(input_file, output_file); result = decompress_2(input_file, output_file);
if (result < 0) { if (result < 0) {
fprintf(stderr, "Chyba: Dekompresia zlyhala.\n"); return 0;
return 1;
} }
} else { } else {
fprintf(stderr, "Chyba: Neznamy argument. Použite -h pre zobrazenie pomoci.\n"); fprintf(stderr, "Chyba: Neznamy argument. Použite -h pre zobrazenie pomoci.\n");