summaryrefslogtreecommitdiff
path: root/Userland/cat.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/cat.cpp')
-rw-r--r--Userland/cat.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/Userland/cat.cpp b/Userland/cat.cpp
index 5454d7e982..d084b532ed 100644
--- a/Userland/cat.cpp
+++ b/Userland/cat.cpp
@@ -8,10 +8,9 @@
int main(int argc, char** argv)
{
- const char* input_file = argc > 1 ? argv[1] : "/dev/stdin";
- int fd = open(input_file, O_RDONLY);
+ int fd = argc > 1 ? open(argv[1], O_RDONLY) : 0;
if (fd == -1) {
- printf("failed to open %s: %s\n", input_file, strerror(errno));
+ printf("failed to open %s: %s\n", argv[1], strerror(errno));
return 1;
}
for (;;) {