From 1461a0b5f3efa09795fc3b12918b12ca25621972 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sat, 14 Mar 2009 23:58:00 +0100 Subject: [PATCH] The judge reports errors in a more useful way They are reported to stderr as two lines: one is the location of the error, another contains the error message. This is parsed by the evaluator and the second line is displayed on the screen, while both are logged. --- judge/token.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/judge/token.c b/judge/token.c index 4606395..85f5069 100644 --- a/judge/token.c +++ b/judge/token.c @@ -34,9 +34,9 @@ void tok_err(struct tokenizer *t, char *msg, ...) { va_list args; va_start(args, msg); - printf("%s:%d: ", t->stream->name, t->line); - vprintf(msg, args); - putchar('\n'); + fprintf(stderr, "Error at %s line %d:\n", t->stream->name, t->line); + vfprintf(stderr, msg, args); + fputc('\n', stderr); va_end(args); exit(1); } -- 2.39.2