|
|
@ -1,4 +1,4 @@ |
|
|
|
/* $OpenBSD: parse.y,v 1.52 2013/11/25 12:58:42 benno Exp $ */ |
|
|
|
/* $OpenBSD: parse.y,v 1.53 2014/11/03 20:15:31 bluhm Exp $ */ |
|
|
|
|
|
|
|
/* |
|
|
|
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org> |
|
|
@ -339,15 +339,15 @@ int |
|
|
|
yyerror(const char *fmt, ...) |
|
|
|
{ |
|
|
|
va_list ap; |
|
|
|
char *nfmt; |
|
|
|
char *msg; |
|
|
|
|
|
|
|
file->errors++; |
|
|
|
va_start(ap, fmt); |
|
|
|
if (asprintf(&nfmt, "%s:%d: %s", file->name, yylval.lineno, fmt) == -1) |
|
|
|
fatalx("yyerror asprintf"); |
|
|
|
vlog(LOG_CRIT, nfmt, ap); |
|
|
|
if (vasprintf(&msg, fmt, ap) == -1) |
|
|
|
fatalx("yyerror vasprintf"); |
|
|
|
va_end(ap); |
|
|
|
free(nfmt); |
|
|
|
logit(LOG_CRIT, "%s:%d: %s", file->name, yylval.lineno, msg); |
|
|
|
free(msg); |
|
|
|
return (0); |
|
|
|
} |
|
|
|
|
|
|
|