Improve error messages
authorbylex <mbilek06@gmail.com>
Wed, 9 Oct 2024 12:32:38 +0000 (14:32 +0200)
committerbylex <mbilek06@gmail.com>
Wed, 9 Oct 2024 12:32:38 +0000 (14:32 +0200)
assembler.c

index 54394fc5d357d013a3a8c5155fccfa260d4276c9..e4cfa61e91cacbb730eb7ccc6cd3bbd1d48d8722 100644 (file)
@@ -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;
        }