1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 09:04:59 +00:00

Userland: Add fopen error handling to less

This commit is contained in:
Ralf Donau 2021-07-10 10:27:43 +02:00 committed by Gunnar Beutner
parent 2e4be5e98c
commit 821b752993

View file

@ -331,8 +331,9 @@ int main(int argc, char** argv)
FILE* file;
if (String("-") == filename) {
file = stdin;
} else {
file = fopen(filename, "r");
} else if ((file = fopen(filename, "r")) == nullptr) {
perror("fopen");
exit(1);
}
if (pledge("stdio tty", nullptr) < 0) {