diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2016-11-11 18:52:16 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2016-11-11 18:55:09 +0200 |
commit | b92047ed10c4da784c296dfcf09da250b7b637c7 (patch) | |
tree | 9329fa2f35857af5cc546ae399e8b0e4c6c91d8f /src | |
parent | 1b89c5a728a99acffff75582f5a4126f5b4d2d4b (diff) | |
download | cflow-b92047ed10c4da784c296dfcf09da250b7b637c7.tar.gz cflow-b92047ed10c4da784c296dfcf09da250b7b637c7.tar.bz2 |
Bugfix
* src/parser.c (tokdel): Fix amount of memory to move.
* THANKS: Niklas Angebrand
Diffstat (limited to 'src')
-rw-r--r-- | src/parser.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/parser.c b/src/parser.c index d2832a1..e5114dc 100644 --- a/src/parser.c +++ b/src/parser.c | |||
@@ -233,13 +233,13 @@ restore(Stackpos pos) | |||
233 | void | 233 | void |
234 | tokdel(int beg, int end) | 234 | tokdel(int beg, int end) |
235 | { | 235 | { |
236 | if (end >= beg) { | 236 | if (end >= beg) { |
237 | if (end < tos) | 237 | if (end < tos) |
238 | memmove(token_stack + beg, token_stack + end + 1, | 238 | memmove(token_stack + beg, token_stack + end + 1, |
239 | (end - beg + 1) * sizeof(token_stack[0])); | 239 | (tos - end - 1) * sizeof(token_stack[0])); |
240 | tos -= (end - beg + 1); | 240 | tos -= (end - beg + 1); |
241 | } | 241 | } |
242 | } | 242 | } |
243 | 243 | ||
244 | void | 244 | void |
245 | tokins(int pos, int type, int line, char *token) | 245 | tokins(int pos, int type, int line, char *token) |