mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 10:18:15 +09:00
Userland: Add fopen error handling to less
This commit is contained in:
parent
2e4be5e98c
commit
821b752993
Notes:
sideshowbarker
2024-07-18 09:26:50 +09:00
Author: https://github.com/doctor-rd
Commit: 821b752993
Pull-request: https://github.com/SerenityOS/serenity/pull/8604
1 changed files with 3 additions and 2 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue