Skip to content

Commit

Permalink
1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
PQCraft authored Jan 25, 2022
1 parent 96de9df commit 3a5d7bf
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion qhd.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* ---------------------------------------------------------------- */
/* */
/* Quick Hex Dump version 1.1 */
/* Quick Hex Dump version 1.1.1 */
/* */
/* (C) 2022 PQCraft */
/* Licensed under the GNU General Public License version 3.0 */
Expand All @@ -20,6 +20,7 @@
#include <errno.h>
#include <string.h>
#include <inttypes.h>
#include <sys/stat.h>

int gargc;
char** gargv;
Expand Down Expand Up @@ -58,6 +59,16 @@ int main(int argc, char** argv) {
aperror(argv[1]);
return 1;
}
int fd = fileno(fp);
struct stat statinfo;
memset(&statinfo, 0, sizeof(statinfo));
fstat(fd, &statinfo);
if (S_ISDIR(statinfo.st_mode)) {
fclose(fp);
errno = EISDIR;
aperror(argv[1]);
return 1;
}
} else {
fp = stdin;
}
Expand Down

0 comments on commit 3a5d7bf

Please sign in to comment.