Skip to content

Commit

Permalink
- Open errLogFile before trying to use it
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@10202 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Oct 24, 2011
1 parent 84159c5 commit d8b24ab
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions FMI/import/source/moGenerator.c
Expand Up @@ -948,6 +948,15 @@ int main(int argc, char *argv[]){
const char * fmuDllPath = NULL; // dll path
// end

// Creating log file
errLogFile = fopen("fmuImportError.log","w");
if(!errLogFile){
printf("#### %s, %s, %d, : Error: Creating file fmuImportError.log failed...\n",__DATE__,__TIME__,__LINE__);
exit(EXIT_FAILURE);
}
printf("\n\n");
// end

if (argc < 2) {
printUsage();
ERRORPRINT; fprintf(errLogFile,"#### Wrong arguments passed to main entry...%s\n","");
Expand All @@ -960,16 +969,7 @@ int main(int argc, char *argv[]){
printUsage();
exit(EXIT_FAILURE);
}

// Creating log file
errLogFile = fopen("fmuImportError.log","w");
if(!errLogFile){
printf("#### %s, %s, %d, : Error: Creating file fmuImportError.log failed...\n",__DATE__,__TIME__,__LINE__);
exit(EXIT_FAILURE);
}
printf("\n\n");
// end


// Attaining the name of the FMU from the argument
// Decompressing the archive into an appropriate directory
// Get the model description xml file name
Expand Down

0 comments on commit d8b24ab

Please sign in to comment.