Skip to content

Commit

Permalink
dont allow empty indexes in wml variables
Browse files Browse the repository at this point in the history
wesnoth.get_variable("a[].b") now gives an error, previously it was the
same as wesnoth.get_variable("a[0].b")
  • Loading branch information
gfgtdf committed Feb 15, 2016
1 parent ba154d0 commit 3f681c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/variable_info.cpp
Expand Up @@ -159,7 +159,7 @@ namespace
char* endptr;
int res = strtol(index_str, &endptr, 10);

if (*endptr != ']' || res > int(game_config::max_loop))
if (*endptr != ']' || res > int(game_config::max_loop) || endptr == index_str)
{
throw invalid_variablename_exception();
}
Expand Down

0 comments on commit 3f681c1

Please sign in to comment.