ref: d314994309c751e5a983797760e8386d82ae60eb
parent: ff2fe1d70fabaf9516f1b5950067941603a50f7b
author: Sigrid Solveig Haflínudóttir <[email protected]>
date: Wed Mar 3 15:47:05 EST 2021
check whether the file even exists
--- a/main.c
+++ b/main.c
@@ -60,6 +60,8 @@
fd = open(*argv, OREAD);
else if(argc != 0)
usage();
+ if(fd < 0)
+ sysfatal("%r");
if(Binits(&f, fd, OREAD, inbuf, Inbufsz) != 0)
sysfatal("%r");