From eda0e0dfa2de861d0021d04d441a8d5809cb0a6d Mon Sep 17 00:00:00 2001 From: Tobias Werth Date: Mon, 26 Aug 2024 21:33:45 +0200 Subject: [PATCH] Avoid recursion on error. --- judge/runguard.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/judge/runguard.cc b/judge/runguard.cc index 2a7dc61a8e9..1eff89f308e 100644 --- a/judge/runguard.cc +++ b/judge/runguard.cc @@ -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); }