klange / toaruos

A completely-from-scratch hobby operating system: bootloader, kernel, drivers, C library, and userspace including a composited graphical UI, dynamic linker, syntax-highlighting text editor, network stack, etc.
https://toaruos.org/
University of Illinois/NCSA Open Source License
6.03k stars 475 forks source link

Fix imgviewer segmentation fault if image file not access for read #192

Closed ZanyXDev closed 4 years ago

ZanyXDev commented 4 years ago

188

Create to small function

  1. int file_exists(char * filename) - check file EXIST
  2. int is_readable(char * filename) - check ability read file.
  3. small cosmetics fix
klange commented 4 years ago

There are several things wrong with this pull request, between not listening to the implementation advice offered in the original ticket, the complete mess of merges and irrelevant commits in your branch, the deep nesting if checks, the code formatting being messed up in several places, and there being dozens of unrelated modifications. I will not be accepting this.

klange commented 4 years ago

I don't want to just leave this with the comment above, so I'm going to post inline comments explaining what is wrong with this pull request.