diff options
author | 2015-07-16 23:02:56 +0000 | |
---|---|---|
committer | 2015-07-16 23:02:56 +0000 | |
commit | 6ced1a259d11600697ae174d3192a6f88ccc64c9 (patch) | |
tree | a2b7fc7ff988cbafb8240a49863b5184364f7d40 | |
parent | The return type of memset(3) is void. No need for a cast. (diff) | |
download | wireguard-openbsd-6ced1a259d11600697ae174d3192a6f88ccc64c9.tar.xz wireguard-openbsd-6ced1a259d11600697ae174d3192a6f88ccc64c9.zip |
Prototype yy* functions, and use verrx in yyerror(). ok tedu
-rw-r--r-- | usr.bin/doas/parse.y | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.bin/doas/parse.y b/usr.bin/doas/parse.y index 80d1e0bb207..089dc4f5d8b 100644 --- a/usr.bin/doas/parse.y +++ b/usr.bin/doas/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.3 2015/07/16 22:33:01 zhuk Exp $ */ +/* $OpenBSD: parse.y,v 1.4 2015/07/16 23:02:56 nicm Exp $ */ /* * Copyright (c) 2015 Ted Unangst <tedu@openbsd.org> * @@ -44,6 +44,10 @@ FILE *yyfp; struct rule **rules; int nrules, maxrules; +void yyerror(const char *, ...); +int yylex(void); +int yyparse(void); + %} %token TPERMIT TDENY TAS TCMD @@ -143,11 +147,7 @@ yyerror(const char *fmt, ...) va_list va; va_start(va, fmt); - fprintf(stderr, "doas: "); - vfprintf(stderr, fmt, va); - fprintf(stderr, "\n"); - va_end(va); - exit(1); + verrx(1, fmt, va); } struct keyword { |