mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:07:36 +00:00
Userland: Replace most printf-style APIs with AK::Format APIs :^)
This commit is contained in:
parent
4f1889c2cb
commit
f5c35fccca
75 changed files with 642 additions and 644 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue