From: bylex Date: Wed, 9 Oct 2024 12:32:38 +0000 (+0200) Subject: Improve error messages X-Git-Url: https://git.bylex.cz/?a=commitdiff_plain;h=c11f1e8d69a46265f33dc8e8c1a082abf9ef21cf;p=maturita.git Improve error messages --- diff --git a/assembler.c b/assembler.c index 54394fc..e4cfa61 100644 --- a/assembler.c +++ b/assembler.c @@ -131,7 +131,7 @@ struct inst_t parse_line(char* line_buffer, struct label_t* labels, unsigned int } if(!label_known) { - perror("Unknown identifier\n"); + fprintf(stderr, "Unknown identifier\n"); exit(1); } break; @@ -177,14 +177,14 @@ int main(int argc, char *argv[]) FILE* input_file = fopen(argv[1], "r"); if(!input_file) { - perror("Cannot open input file for reading\n"); + perror("Error opening input file"); return 1; } FILE* output_file = fopen(argv[2], "wb"); if(!output_file) { - perror("Cannot open output file for writing\n"); + perror("Error opening output file\n"); return 1; }