summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y8
1 files changed, 4 insertions, 4 deletions
diff --git a/parse.y b/parse.y
index 3182ceee0e..8803ddff87 100644
--- a/parse.y
+++ b/parse.y
@@ -4917,13 +4917,13 @@ parser_newtok(struct parser_params *parser)
static char *
parser_tokspace(struct parser_params *parser, int n)
{
- int idx = tokidx + n;
+ tokidx += n;
- if (idx >= toksiz) {
- do {toksiz *= 2;} while (toksiz < idx);
+ if (tokidx >= toksiz) {
+ do {toksiz *= 2;} while (toksiz < tokidx);
REALLOC_N(tokenbuf, char, toksiz);
}
- return &tokenbuf[tokidx];
+ return &tokenbuf[tokidx-n];
}
static void