diff options
author | Andreas Kling <kling@serenityos.org> | 2020-06-08 21:57:13 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-06-08 21:57:13 +0200 |
commit | a85506009fc11513d48b7f821917fc9e2324d811 (patch) | |
tree | 9f164f210e058a76f6e3b43144d4f09b8edfb338 /Libraries | |
parent | c88ea2f54aa76f29aa538a74e262221ed66c5c58 (diff) | |
download | serenity-a85506009fc11513d48b7f821917fc9e2324d811.zip |
LibC: Don't assert on unknown mode character in fopen()
Just carry on with some debug log whining.
Gets rid of one dropbear patch. :^)
Diffstat (limited to 'Libraries')
-rw-r--r-- | Libraries/LibC/stdio.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Libraries/LibC/stdio.cpp b/Libraries/LibC/stdio.cpp index 2de6f2d95d..1c473c3288 100644 --- a/Libraries/LibC/stdio.cpp +++ b/Libraries/LibC/stdio.cpp @@ -913,8 +913,8 @@ static int parse_mode(const char* mode) // NOTE: rt is a non-standard mode which opens a file for read, explicitly // specifying that it's a text file - for (; *mode; ++mode) { - switch (*mode) { + for (auto* ptr = mode; *ptr; ++ptr) { + switch (*ptr) { case 'r': flags |= O_RDONLY; break; @@ -937,8 +937,7 @@ static int parse_mode(const char* mode) // Ok... break; default: - dbg() << "Unsupported mode _" << mode << "_ (because of '" << *mode << "')"; - ASSERT_NOT_REACHED(); + dbg() << "Potentially unsupported fopen mode _" << mode << "_ (because of '" << *ptr << "')"; } } |