summaryrefslogtreecommitdiff
path: root/flex.skl
diff options
context:
space:
mode:
authorWill Estes <wlestes@users.sourceforge.net>2007-03-07 21:50:24 +0000
committerWill Estes <wlestes@users.sourceforge.net>2007-03-07 21:50:24 +0000
commit2658075a3483f4cb7256b520a1405756302d7bf1 (patch)
tree8e3c401463bbc9c73699c5b2b039999d044538b8 /flex.skl
parent158a4ad508a43b8e55e7b828a63452f3704dd03f (diff)
apply patches submitted by sodabrew
Diffstat (limited to 'flex.skl')
-rw-r--r--flex.skl7
1 files changed, 7 insertions, 0 deletions
diff --git a/flex.skl b/flex.skl
index 3cf3064..4ab57c9 100644
--- a/flex.skl
+++ b/flex.skl
@@ -1647,6 +1647,13 @@ m4_ifdef( [[M4_YY_USES_REJECT]],
else
ret_val = EOB_ACT_CONTINUE_SCAN;
+ if ((yy_size_t) (yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+ /* Extend the array by 50%, plus the number we really need. */
+ yy_size_t new_size = yy_n_chars + number_to_move + (yy_n_chars >> 1);
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
+ (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, new_size);
+ }
+
YY_G(yy_n_chars) += number_to_move;
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_G(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_G(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;