diff options
Diffstat (limited to 'awkgram.c')
-rw-r--r-- | awkgram.c | 18 |
1 files changed, 4 insertions, 14 deletions
@@ -3400,7 +3400,7 @@ regular_print: n1 = force_string(n1); n2 = force_string(n2); nlen = n1->stlen + n2->stlen; - erealloc(n1->stptr, char *, nlen + 2, "constant fold"); + erealloc(n1->stptr, char *, nlen + 1, "constant fold"); memcpy(n1->stptr + n1->stlen, n2->stptr, n2->stlen); n1->stlen = nlen; n1->stptr[nlen] = '\0'; @@ -4517,7 +4517,6 @@ yyerror(const char *m, ...) char *buf; int count; static char end_of_file_line[] = "(END OF FILE)"; - char save; print_included_from(); @@ -4545,24 +4544,15 @@ yyerror(const char *m, ...) bp = thisline + strlen(thisline); } - /* - * Saving and restoring *bp keeps valgrind happy, - * since the guts of glibc uses strlen, even though - * we're passing an explict precision. Sigh. - * - * 8/2003: We may not need this anymore. - */ - save = *bp; - *bp = '\0'; - msg("%.*s", (int) (bp - thisline), thisline); - *bp = save; va_start(args, m); if (mesg == NULL) mesg = m; - count = (bp - thisline) + strlen(mesg) + 2 + 1; + count = strlen(mesg) + 1; + if (lexptr != NULL) + count += (lexeme - thisline) + 2; emalloc(buf, char *, count, "yyerror"); bp = buf; |