Correctly handle files that contain no slides

Otherwise, on reloading sent would segfault. Move the check-logic to
load() rather than doing it in main() to prevent other misuses of it in
the future.
master
Laslo Hunhold 7 years ago committed by Markus Teich
parent 53541ee1bd
commit a5f760fa0e

@ -457,6 +457,9 @@ load(FILE *fp)
if (!p)
break;
}
if (!slidecount)
die("sent: No slides in file");
}
void
@ -695,9 +698,6 @@ main(int argc, char *argv[])
load(fp);
fclose(fp);
if (!slidecount)
usage();
xinit();
run();

Loading…
Cancel
Save