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

Loading…
Cancel
Save