diff options
author | Haru <haru@dotalux.com> | 2018-07-25 06:19:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-25 06:19:22 +0200 |
commit | 67b1035c8fc0211dcbc9569c9de0ff4a774a69d7 (patch) | |
tree | d26cecc880e47519fa0f2afd3b0f38746054d09c /src/map/script.c | |
parent | bd1d37da3e3ac938065e52e264753555339adc66 (diff) | |
parent | 90de9174210664e1c5af4db59868709d25226545 (diff) | |
download | hercules-67b1035c8fc0211dcbc9569c9de0ff4a774a69d7.tar.gz hercules-67b1035c8fc0211dcbc9569c9de0ff4a774a69d7.tar.bz2 hercules-67b1035c8fc0211dcbc9569c9de0ff4a774a69d7.tar.xz hercules-67b1035c8fc0211dcbc9569c9de0ff4a774a69d7.zip |
Merge pull request #2093 from AnnieRuru/47-MAX_ARRAYSIZE
Fix SCRIPT_MAX_ARRAYSIZE
Diffstat (limited to 'src/map/script.c')
-rw-r--r-- | src/map/script.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/map/script.c b/src/map/script.c index 1e635b622..24d03bbe2 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -4929,7 +4929,7 @@ static void script_setarray_pc(struct map_session_data *sd, const char *varname, { int key; - if( idx >= SCRIPT_MAX_ARRAYSIZE ) { + if (idx > SCRIPT_MAX_ARRAYSIZE) { ShowError("script_setarray_pc: Variable '%s' has invalid index '%u' (char_id=%d).\n", varname, idx, sd->status.char_id); return; } @@ -7540,7 +7540,7 @@ static BUILDIN(getelementofarray) id = reference_getid(data); i = script_getnum(st, 3); - if (i < 0 || i >= SCRIPT_MAX_ARRAYSIZE) { + if (i < 0 || i > SCRIPT_MAX_ARRAYSIZE) { ShowWarning("script:getelementofarray: index out of range (%"PRId64")\n", i); script->reportdata(data); script_pushnil(st); |