1
0
mirror of https://git.sr.ht/~sircmpwn/gmni synced 2024-11-23 09:02:04 +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:
Leon Henrik Plickat 2020-09-22 13:39:03 +02:00 committed by Drew DeVault
parent 60cf41e7dd
commit b25b4576e3

@ -797,7 +797,9 @@ main(int argc, char *argv[])
}
if (optind == argc - 1) {
set_url(&browser, argv[optind], &browser.history);
if (!set_url(&browser, argv[optind], &browser.history)) {
return 1;
}
} else {
usage(argv[0]);
return 1;