! fopen_orDie() : * Open a file using given file path and open option. * * @return If successful this function will return a FILE pointer to an * opened file otherwise it sends an error to stderr and exits. */
| 97 | * opened file otherwise it sends an error to stderr and exits. |
| 98 | */ |
| 99 | static FILE* fopen_orDie(const char *filename, const char *instruction) |
| 100 | { |
| 101 | FILE* const inFile = fopen(filename, instruction); |
| 102 | if (inFile) return inFile; |
| 103 | /* error */ |
| 104 | perror(filename); |
| 105 | exit(ERROR_fopen); |
| 106 | } |
| 107 | |
| 108 | /*! fclose_orDie() : |
| 109 | * Close an opened file using given FILE pointer. |
no outgoing calls
no test coverage detected