mirror of
https://github.com/linux-msm/qmic.git
synced 2026-02-25 13:11:34 -08:00
parser: don't bother with a buffer in yyerror()
Just print the message passed to yyerror(); don't bother putting it into a buffer first. Signed-off-by: Alex Elder <elder@linaro.org> Message-Id: <20211001232338.769309-4-elder@linaro.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
This commit is contained in:
committed by
Bjorn Andersson
parent
8dcad17a55
commit
23710a79b3
7
parser.c
7
parser.c
@@ -183,15 +183,16 @@ static struct token curr_token;
|
||||
|
||||
static void yyerror(const char *fmt, ...)
|
||||
{
|
||||
char buf[128];
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
|
||||
vsprintf(buf, fmt, ap);
|
||||
printf("parse error on line %u: %s\n", yyline, buf);
|
||||
printf("parse error on line %u:\n\t", yyline);
|
||||
vprintf(fmt, ap);
|
||||
printf("\n");
|
||||
|
||||
va_end(ap);
|
||||
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user