From 4ae056b1a3b5cf23916db83027cc1206e07f9b52 Mon Sep 17 00:00:00 2001 From: Jon Siwek Date: Thu, 8 Apr 2021 20:13:50 -0700 Subject: [PATCH] Escape non-printables in "unrecognized character" parser error messages --- src/scan.l | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scan.l b/src/scan.l index 5052e7583c..4a7c9f363a 100644 --- a/src/scan.l +++ b/src/scan.l @@ -565,7 +565,7 @@ F RET_CONST(zeek::val_mgr->False()->Ref()) [\\\n] return yytext[0]; // should cause a parse error -<*>. zeek::reporter->Error("unrecognized character - %s", yytext); +<*>. zeek::reporter->Error("unrecognized character: '%s'", zeek::util::get_escaped_string(yytext, false).data()); <> last_tok[0] = '\0'; return EOF;