projects
/
sent.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
53541ee
)
Correctly handle files that contain no slides
author
Laslo Hunhold
<dev@frign.de>
Thu, 7 Sep 2017 09:01:10 +0000
(11:01 +0200)
committer
Markus Teich
<teichm@fs.tum.de>
Thu, 7 Sep 2017 21:37:00 +0000
(23:37 +0200)
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.
sent.c
patch
|
blob
|
history
diff --git
a/sent.c
b/sent.c
index 0da2bfffdbe018ac1ad5a6c4cabfe32915ac93e1..c50a572c24269769d1a84e1bb584df84278991e1 100644
(file)
--- a/
sent.c
+++ b/
sent.c
@@
-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();