Improve file related error reporting, allow for creating CWAV and LZ11 compressed files.

This commit is contained in:
Steveice10
2015-01-24 10:53:59 -08:00
parent eee39ef565
commit 45a90edba5
3 changed files with 91 additions and 2 deletions

View File

@@ -3,6 +3,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
bool find_chunk(FILE* fd, const char* magic) {
char curr[5] = {0};
@@ -20,7 +21,7 @@ bool find_chunk(FILE* fd, const char* magic) {
WAV* read_wav(const char* file) {
FILE* fd = fopen(file, "r");
if(!fd) {
printf("ERROR: Could not open WAV file.\n");
printf("ERROR: Could not open WAV file: %s\n", strerror(errno));
return NULL;
}