Sanity-check the stack-limit argument (limit needs to be > 0)

next
Michael Stapelberg 2010-09-01 14:31:25 +02:00
parent 5403fac512
commit 53d6f476bc
1 changed files with 15 additions and 11 deletions

View File

@ -393,6 +393,9 @@ new_container:
} }
| TOKNEWCONTAINER WHITESPACE TOKSTACKLIMIT WHITESPACE TOKSTACKLIMIT WHITESPACE NUMBER | TOKNEWCONTAINER WHITESPACE TOKSTACKLIMIT WHITESPACE TOKSTACKLIMIT WHITESPACE NUMBER
{ {
if ($<number>7 <= 0) {
ELOG("Invalid stack-limit, need a limit which is > 0\n");
} else {
DLOG("stack-limit %d with val %d\n", $<number>5, $<number>7); DLOG("stack-limit %d with val %d\n", $<number>5, $<number>7);
config.container_stack_limit = $<number>5; config.container_stack_limit = $<number>5;
config.container_stack_limit_value = $<number>7; config.container_stack_limit_value = $<number>7;
@ -407,6 +410,7 @@ new_container:
con->stack_limit_value = config.container_stack_limit_value; con->stack_limit_value = config.container_stack_limit_value;
} }
} }
}
; ;
new_window: new_window: