Added rtti-reader and made various cleanups, switching to Shutdown_M for error handling

This commit is contained in:
Fatbag 2012-12-03 12:31:24 -06:00
parent 5444c9aea6
commit 6dddbd2efa
25 changed files with 771 additions and 194 deletions

View file

@ -119,6 +119,7 @@ int main(int argc, char *argv[]){
fseek(hFile, 0, SEEK_END);
FileSize = ftell(hFile);
if(FileSize < 64){
fclose(hFile);
printf("%sNot a valid IFF file.", "iff2html: error: ");
return -1;
}
@ -126,10 +127,12 @@ int main(int argc, char *argv[]){
IFFData = malloc(FileSize);
if(IFFData == NULL){
fclose(hFile);
printf("%sMemory for this file could not be allocated.", "iff2html: error: ");
return -1;
}
if(!fread(IFFData, FileSize, 1, hFile)){
if(fread(IFFData, 1, FileSize, hFile) != FileSize){
fclose(hFile);
printf("%sThe input file could not be read.", "iff2html: error: ");
return -1;
}