summaryrefslogtreecommitdiff
path: root/src/init/shell.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/init/shell.c')
-rw-r--r--src/init/shell.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/init/shell.c b/src/init/shell.c
index 53ad995..33f6da3 100644
--- a/src/init/shell.c
+++ b/src/init/shell.c
@@ -44,10 +44,13 @@ static int readline(char *buf, size_t max) {
}
static void cmd_cat(const char *args) {
- int fd = _syscall_open(args, strlen(args));
+ int fd;
static char buf[256];
int len = 256;
+ if (!args) return; // no argument
+
+ fd = _syscall_open(args, strlen(args));
if (fd < 0) {
printf("couldn't open.\n");
return;