1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-23 12:18:05 +11:00

tools/exec: fix segfault

This commit is contained in:
Virgil Dupras 2020-11-17 17:02:10 -05:00
parent 959382c079
commit 631e7f1008

View File

@ -19,6 +19,10 @@ int main(int argc, char **argv)
FILE *fp = stdin;
if (strcmp(argv[2], "-") != 0) {
fp = fopen(argv[2], "r");
if (fp == NULL) {
fprintf(stderr, "Could not open %s\n", argv[2]);
return 1;
}
}
int fd = ttyopen(argv[1]);
if (fd < 0) {