summaryrefslogtreecommitdiff
path: root/Userland/Utilities
diff options
context:
space:
mode:
authorBen Wiederhake <BenWiederhake.GitHub@gmx.de>2023-05-13 01:09:22 +0200
committerAndrew Kaster <andrewdkaster@gmail.com>2023-05-14 15:42:57 -0600
commitb65d49669ae91eaec6a4c103763b88f191ba53e7 (patch)
tree788666658c60c74b9b8eda50fbdd8448b8dd1e20 /Userland/Utilities
parentb10106fc7dbae73a7703b9cc6af8cfc0cf579c8e (diff)
downloadserenity-b65d49669ae91eaec6a4c103763b88f191ba53e7.zip
test-imap: Prefer Core::File over DeprecatedFile
Diffstat (limited to 'Userland/Utilities')
-rw-r--r--Userland/Utilities/test-imap.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Utilities/test-imap.cpp b/Userland/Utilities/test-imap.cpp
index de55539271..218a2ea6fb 100644
--- a/Userland/Utilities/test-imap.cpp
+++ b/Userland/Utilities/test-imap.cpp
@@ -5,11 +5,11 @@
*/
#include <LibCore/ArgsParser.h>
-#include <LibCore/DeprecatedFile.h>
#include <LibCore/EventLoop.h>
#include <LibCore/GetPassword.h>
#include <LibIMAP/Client.h>
#include <LibMain/Main.h>
+#include <unistd.h>
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
@@ -24,7 +24,6 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
DeprecatedString username;
Core::SecretString password;
-
bool interactive_password;
Core::ArgsParser args_parser;
@@ -38,8 +37,9 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
if (interactive_password) {
password = TRY(Core::get_password());
} else {
- auto standard_input = Core::DeprecatedFile::standard_input();
- password = Core::SecretString::take_ownership(standard_input->read_all());
+ auto standard_input = TRY(Core::File::standard_input());
+ // This might leave the clear password in unused memory, but this is only a test program anyway.
+ password = Core::SecretString::take_ownership(TRY(standard_input->read_until_eof()));
}
Core::EventLoop loop;