[cat] handle load failure without seg faulting

This commit is contained in:
Kevin Lange 2012-01-23 14:24:23 -06:00
parent ed31c2cbea
commit ee1ade379f

View File

@ -9,6 +9,9 @@ int main(int argc, char ** argv) {
FILE * fd = stdin;
if (argc > 1) {
fd = fopen(argv[1], "r");
if (!fd) {
return 1;
}
}
size_t length;