abort with failure if no domain is passed to psl in a mode where it tries to work with domains

This commit is contained in:
Daniel Kahn Gillmor 2014-06-06 01:14:40 -04:00
parent 9b9c3a35c1
commit 1addfb07a0
1 changed files with 9 additions and 3 deletions

View File

@ -130,10 +130,16 @@ int main(int argc, const char *const *argv)
break; break;
} }
if (!psl && mode != 99) { if (mode != 99) {
printf("No PSL data available - aborting\n"); if (!psl) {
fprintf(stderr, "No PSL data available - aborting\n");
exit(2); exit(2);
} }
if (arg >= argv + argc) {
fprintf(stderr, "No domains given - aborting\n");
exit(3);
}
}
if (mode == 1) { if (mode == 1) {
for (; arg < argv + argc; arg++) for (; arg < argv + argc; arg++)