mirror of
https://github.com/lua/lua
synced 2025-04-13 00:12:53 +03:00
negative stack sizes are invalid, too.
This commit is contained in:
parent
100bfec39a
commit
d63afba9d3
4
lua.c
4
lua.c
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lua.c,v 1.46 2000/08/28 17:57:04 roberto Exp roberto $
|
** $Id: lua.c,v 1.47 2000/08/29 14:33:31 roberto Exp roberto $
|
||||||
** Lua stand-alone interpreter
|
** Lua stand-alone interpreter
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -286,7 +286,7 @@ static int handle_argv (char *argv[], struct Options *opt) {
|
|||||||
static void getstacksize (int argc, char *argv[], struct Options *opt) {
|
static void getstacksize (int argc, char *argv[], struct Options *opt) {
|
||||||
if (argc >= 2 && argv[1][0] == '-' && argv[1][1] == 's') {
|
if (argc >= 2 && argv[1][0] == '-' && argv[1][1] == 's') {
|
||||||
int stacksize = atoi(&argv[1][2]);
|
int stacksize = atoi(&argv[1][2]);
|
||||||
if (stacksize == 0) {
|
if (stacksize <= 0) {
|
||||||
fprintf(stderr, "lua: invalid stack size ('%s')\n", &argv[1][2]);
|
fprintf(stderr, "lua: invalid stack size ('%s')\n", &argv[1][2]);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user