Browse Source

Don't crash the entire program on failed to open file.

rexim 3 năm trước cách đây
mục cha
commit
082d00943a
1 tập tin đã thay đổi với 1 bổ sung3 xóa
  1. 1 3
      img2term.c

+ 1 - 3
img2term.c

@@ -643,10 +643,8 @@ int main(int argc, char **argv)
             int width, height;
             uint32_t *pixels = (uint32_t*)stbi_load(file_path, &width, &height, NULL, 4);
             if (pixels == NULL) {
-                // TODO: don't crash the entire program on failed to open file.
-                // Just continue processing the files.
                 fprintf(stderr, "ERROR: could not read file %s\n", file_path);
-                exit(1);
+                continue;
             }
 
             int resized_height = height*resized_width/width;