an empty string isn't a valid number
This commit is contained in:
parent
4dc04defe2
commit
eb622a0b8a
|
@ -137,7 +137,7 @@ static void launch_url(const char *text, search_panel_info *info) {
|
||||||
errno = 0;
|
errno = 0;
|
||||||
unsigned long id = strtoul(text, &end, 10);
|
unsigned long id = strtoul(text, &end, 10);
|
||||||
|
|
||||||
if (!errno && *end == '\0' && id < info->url_list.size()) {
|
if (!errno && end != text && *end == '\0' && id < info->url_list.size()) {
|
||||||
browser_cmd[1] = info->url_list[id].url;
|
browser_cmd[1] = info->url_list[id].url;
|
||||||
g_spawn_async(NULL, (char **)browser_cmd, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL);
|
g_spawn_async(NULL, (char **)browser_cmd, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue