diff --git a/apps/cat.cpp b/apps/cat.cpp index 8523b8df..5ac525fb 100644 --- a/apps/cat.cpp +++ b/apps/cat.cpp @@ -14,11 +14,12 @@ static Result do_cat(StringView path) else f = TRY(File::open(path, File::ReadOnly)); + auto buf = TRY(Buffer::create_sized(4096)); while (1) { - String line = TRY(f->read_line()); - if (line.is_empty()) break; - out->write(line.view()); + TRY(f->read(buf, 4096)); + if (buf.is_empty()) break; + out->write(buf); } return {};