mirror of
https://git.sr.ht/~sircmpwn/gmni
synced 2024-11-23 13:13:26 +01:00
Correctly abort when launched with invalid URL
The return value of set_url() was not checked, meaning that when it failed, gmnlm continued anyway, causing an assertion to fail and subsequentially resulting in a segfault.
This commit is contained in:
parent
60cf41e7dd
commit
b25b4576e3
@ -797,7 +797,9 @@ main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (optind == argc - 1) {
|
if (optind == argc - 1) {
|
||||||
set_url(&browser, argv[optind], &browser.history);
|
if (!set_url(&browser, argv[optind], &browser.history)) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
usage(argv[0]);
|
usage(argv[0]);
|
||||||
return 1;
|
return 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user