diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2006-04-18 16:59:03 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2006-04-18 16:59:03 +0000 |
commit | 217a89e89b7c7020dfa32c4be7141ac104d48ddf (patch) | |
tree | d0d1d47a0611e5826401dd55061d9dcffaab377c /lib | |
parent | bae5febc111d5c6df5f025a4bf16f46c6aad435a (diff) |
vis() illegal characters; ok otto
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libpcap/scanner.l | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/libpcap/scanner.l b/lib/libpcap/scanner.l index 1f5ba302335..e26c5a0a657 100644 --- a/lib/libpcap/scanner.l +++ b/lib/libpcap/scanner.l @@ -1,5 +1,5 @@ %{ -/* $OpenBSD: scanner.l,v 1.16 2005/10/07 19:32:39 mpf Exp $ */ +/* $OpenBSD: scanner.l,v 1.17 2006/04/18 16:59:02 deraadt Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 @@ -24,7 +24,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /cvs/OpenBSD/src/lib/libpcap/scanner.l,v 1.16 2005/10/07 19:32:39 mpf Exp $ (LBL)"; + "@(#) $Header: /cvs/OpenBSD/src/lib/libpcap/scanner.l,v 1.17 2006/04/18 16:59:02 deraadt Exp $ (LBL)"; #endif #include <sys/types.h> @@ -33,6 +33,7 @@ static const char rcsid[] = #include <ctype.h> #include <string.h> #include <unistd.h> +#include <vis.h> #include "pcap-int.h" @@ -269,7 +270,12 @@ action return PF_ACTION; "\\"[^ !()\n\t]+ { yylval.s = sdup((char *)yytext + 1); return ID; } [^ \[\]\t\n\-_.A-Za-z0-9!<>()&|=]+i { bpf_error("illegal token: %s\n", yytext); } -. { bpf_error("illegal char '%c'", *yytext); } +. { + char v[5]; + + vis(v, *yytext, VIS_OCTAL, 0); + bpf_error("illegal char '%s'", v); + } %% void lex_init(buf) |