aboutsummaryrefslogtreecommitdiff
path: root/src/ppm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ppm.c')
-rw-r--r--src/ppm.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/ppm.c b/src/ppm.c
index 57a402b..eb309cb 100644
--- a/src/ppm.c
+++ b/src/ppm.c
@@ -8,12 +8,12 @@ void save_as_ppm(char* file_path, small_t *t, size_t width, size_t height, size_
{
FILE *fp = fopen(file_path, "wb");
if(!fp) {
- fprintf(stderr, "ERROR: Could not open file: %s\n", file_path);
+ err("Could not open file: %s\n", file_path);
exit(EXIT_FAILURE);
}
if(scaler == 0) {
- fprintf(stderr, "ERROR: Invalid value for scaler %ld\n", scaler);
+ err("Invalid value for scaler %ld\n", scaler);
exit(EXIT_FAILURE);
}
@@ -33,7 +33,7 @@ char *load_from_ppm(char *file_path, size_t *width, size_t *height)
{
FILE *fp = fopen(file_path, "rb");
if(!fp) {
- fprintf(stderr, "ERROR: Could not open file: %s\n", file_path);
+ err("Could not open file: %s\n", file_path);
exit(EXIT_FAILURE);
}
@@ -41,7 +41,7 @@ char *load_from_ppm(char *file_path, size_t *width, size_t *height)
fgets(line, sizeof(line), fp);
if(strncmp(line, "P6", 2) != 0) {
- fprintf(stderr, "ERROR: PPM header is not correct of file: %s\n", file_path);
+ err("PPM header is not correct of file: %s\n", file_path);
exit(EXIT_FAILURE);
}
@@ -51,7 +51,7 @@ char *load_from_ppm(char *file_path, size_t *width, size_t *height)
fgets(line, sizeof(line), fp);
if(atoi(line) != 255) {
- printf("Maximum color value must be 255");
+ err("Maximum color value must be 255");
exit(1);
}