aboutsummaryrefslogtreecommitdiff
path: root/src/ppm.c
diff options
context:
space:
mode:
authorkartofen <mladenovnasko0@gmail.com>2022-12-21 01:06:18 +0200
committerkartofen <mladenovnasko0@gmail.com>2022-12-21 01:06:18 +0200
commit85601f555a3a57db44631706a25e0f933afd8551 (patch)
tree576f7f7518ebd6f7d1b6f3534218c747d2a14a43 /src/ppm.c
parent88dd7e5fb0798d441dab81e9173d0e2d63f0b75e (diff)
works with different connections
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);
}