Skip to content

Commit eda0e0d

Browse files
committed
Avoid recursion on error.
1 parent 4d10aa2 commit eda0e0d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

judge/runguard.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,12 +308,15 @@ void write_meta(const char *key, const char *format, ...)
308308
va_start(ap,format);
309309

310310
if ( fprintf(metafile,"%s: ",key)<=0 ) {
311+
outputmeta = 0;
311312
error(0,"cannot write to file `%s'",metafilename);
312313
}
313314
if ( vfprintf(metafile,format,ap)<0 ) {
315+
outputmeta = 0;
314316
error(0,"cannot write to file `%s'(vfprintf)",metafilename);
315317
}
316318
if ( fprintf(metafile,"\n")<=0 ) {
319+
outputmeta = 0;
317320
error(0,"cannot write to file `%s'",metafilename);
318321
}
319322

0 commit comments

Comments
 (0)