diff --git a/hmmlconv/hmmlconv.c b/hmmlconv/hmmlconv.c index 6ca3941..e605bc9 100644 --- a/hmmlconv/hmmlconv.c +++ b/hmmlconv/hmmlconv.c @@ -400,6 +400,8 @@ int ProcessFile(char *InFileName, FILE *InFile, FILE *OutFile) Done: fputs("[/video]\n", OutFile); free(Contents); + + return 1; } int main(int ArgC, char **Args) @@ -442,7 +444,7 @@ int main(int ArgC, char **Args) char OutNameBuf[strlen(OutDirName) + strlen(FileNameBase) + 7]; sprintf(OutNameBuf, "%s/%s.hmml", OutDirName, FileNameBase); - FILE *OutFile; + FILE *OutFile = NULL; { int OpenFlags = O_CREAT | O_EXCL | O_WRONLY; @@ -479,7 +481,7 @@ OpenOutput:; fprintf(stderr, "Error opening %s: %s\n", Args[i], strerror(errno)); } - if(!InFile || !OutFile || !ProcessFile(FileNameBase, InFile, OutFile)) + if(InFile && OutFile && !ProcessFile(FileNameBase, InFile, OutFile)) { ++Errors; }