Skip to content

Commit

Permalink
Avoid recursion on error.
Browse files Browse the repository at this point in the history
  • Loading branch information
meisterT committed Aug 26, 2024
1 parent 4d10aa2 commit eda0e0d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions judge/runguard.cc
Original file line number Diff line number Diff line change
Expand Up @@ -308,12 +308,15 @@ void write_meta(const char *key, const char *format, ...)
va_start(ap,format);

if ( fprintf(metafile,"%s: ",key)<=0 ) {
outputmeta = 0;
error(0,"cannot write to file `%s'",metafilename);
}
if ( vfprintf(metafile,format,ap)<0 ) {
outputmeta = 0;
error(0,"cannot write to file `%s'(vfprintf)",metafilename);
}
if ( fprintf(metafile,"\n")<=0 ) {
outputmeta = 0;
error(0,"cannot write to file `%s'",metafilename);
}

Expand Down

0 comments on commit eda0e0d

Please sign in to comment.