bounds check is too strict (off-by-one at the end)

This commit is contained in:
Daniel Micay 2012-09-18 15:54:24 -04:00
parent 742ed9c6c4
commit f913bc054d
1 changed files with 1 additions and 1 deletions

View File

@ -137,7 +137,7 @@ static void launch_url(const char *text, search_panel_info *info) {
errno = 0;
unsigned long id = strtoul(text, &end, 10);
if (!errno && end != text && *end == '\0' && id && id < info->url_list.size()) {
if (!errno && end != text && *end == '\0' && id && id <= info->url_list.size()) {
browser_cmd[1] = info->url_list[id - 1].url;
g_spawn_async(NULL, (char **)browser_cmd, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL);
} else {