1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 11:37:34 +00:00

Userland: Replace most printf-style APIs with AK::Format APIs :^)

This commit is contained in:
Linus Groh 2021-05-31 15:43:25 +01:00
parent 4f1889c2cb
commit f5c35fccca
75 changed files with 642 additions and 644 deletions

View file

@ -25,13 +25,12 @@ int main([[maybe_unused]] int argc, [[maybe_unused]] char** argv)
unveil(nullptr, nullptr);
auto f = Core::File::construct("/proc/dmesg");
if (!f->open(Core::OpenMode::ReadOnly)) {
fprintf(stderr, "open: failed to open /proc/dmesg: %s\n", f->error_string());
auto file = Core::File::construct("/proc/dmesg");
if (!file->open(Core::OpenMode::ReadOnly)) {
warnln("Failed to open {}: {}", file->name(), file->error_string());
return 1;
}
const auto& b = f->read_all();
for (size_t i = 0; i < b.size(); ++i)
putchar(b[i]);
auto buffer = file->read_all();
out("{}", String::copy(buffer));
return 0;
}