~vdupras/collapseos

631e7f100807291c9857fd65b0b90e41a176a3bd — Virgil Dupras 18 days ago 959382c
tools/exec: fix segfault
1 files changed, 4 insertions(+), 0 deletions(-)

M tools/exec.c
M tools/exec.c => tools/exec.c +4 -0
@@ 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) {