Skip to content

Commit 97ad0bf

Browse files
adrpoOpenModelica-Hudson
authored andcommitted
check if the file is valid
Belonging to [master]: - OpenModelica/OMCompiler#2519
1 parent 5e99170 commit 97ad0bf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Compiler/runtime/SimulationResultsCmpTubes.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,12 @@ static unsigned int cmpDataTubes(int isResultCmp, char* varname, DataField *time
743743
fname = (char*) omc_alloc_interface.malloc_atomic(25 + strlen(prefix) + strlen(varname));
744744
sprintf(fname, "%s.%s.csv", prefix, varname);
745745
fout = fopen(fname,"w");
746+
if (!fout)
747+
{
748+
perror("Error opening file");
749+
fprintf(stderr, "File: %s\n", fname);
750+
fflush(stderr);
751+
}
746752
}
747753
maxn = intmax(intmax(intmax(ref.size,actual.size),priv->countHigh),priv->countLow);
748754
if (fout) {

0 commit comments

Comments
 (0)