diff options
author | Ben Wiederhake <BenWiederhake.GitHub@gmx.de> | 2023-05-07 23:09:29 +0200 |
---|---|---|
committer | Sam Atkins <atkinssj@gmail.com> | 2023-05-12 19:46:54 +0100 |
commit | 97e60f2c7de6ee624b50b0eec821f974eaf660d6 (patch) | |
tree | c79ee992d89b3ce0e273f9b58a296040e538caae /Userland/Libraries | |
parent | 37b5bfa06864596a2603e284cc57023f2c633ce5 (diff) | |
download | serenity-97e60f2c7de6ee624b50b0eec821f974eaf660d6.zip |
LibKeyboard: Read keymap through File, not DeprecatedFile
This results in a new OOM prevention. Hooray!
Diffstat (limited to 'Userland/Libraries')
-rw-r--r-- | Userland/Libraries/LibKeyboard/CharacterMapFile.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Libraries/LibKeyboard/CharacterMapFile.cpp b/Userland/Libraries/LibKeyboard/CharacterMapFile.cpp index 38e5904549..56efd8c207 100644 --- a/Userland/Libraries/LibKeyboard/CharacterMapFile.cpp +++ b/Userland/Libraries/LibKeyboard/CharacterMapFile.cpp @@ -7,7 +7,7 @@ #include "CharacterMapFile.h" #include <AK/ByteBuffer.h> #include <AK/Utf8View.h> -#include <LibCore/DeprecatedFile.h> +#include <LibCore/File.h> namespace Keyboard { @@ -22,8 +22,8 @@ ErrorOr<CharacterMapData> CharacterMapFile::load_from_file(DeprecatedString cons path = full_path.to_deprecated_string(); } - auto file = TRY(Core::DeprecatedFile::open(path, Core::OpenMode::ReadOnly)); - auto file_contents = file->read_all(); + auto file = TRY(Core::File::open(path, Core::File::OpenMode::Read)); + auto file_contents = TRY(file->read_until_eof()); auto json_result = TRY(JsonValue::from_string(file_contents)); auto const& json = json_result.as_object(); |