aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2016-11-11 18:52:16 +0200
committerSergey Poznyakoff <gray@gnu.org>2016-11-11 18:55:09 +0200
commitb92047ed10c4da784c296dfcf09da250b7b637c7 (patch)
tree9329fa2f35857af5cc546ae399e8b0e4c6c91d8f /src
parent1b89c5a728a99acffff75582f5a4126f5b4d2d4b (diff)
downloadcflow-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.c2
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)
233void 233void
234tokdel(int beg, int end) 234tokdel(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
244void 244void
245tokins(int pos, int type, int line, char *token) 245tokins(int pos, int type, int line, char *token)

Return to:

Send suggestions and report system problems to the System administrator.