diff --git a/src/user/app/cat/cat.c b/src/user/app/cat/cat.c index b7820be..70a2465 100644 --- a/src/user/app/cat/cat.c +++ b/src/user/app/cat/cat.c @@ -5,7 +5,7 @@ #define BLOCK_SIZE 65536 exit_code_t pass(uint64_t fd) { - static char buffer[BLOCK_SIZE]; + char buffer[BLOCK_SIZE]; uint64_t bytes; while ((bytes = read(fd, BLOCK_SIZE, buffer))) { if (bytes == (uint64_t)-1) { diff --git a/src/user/app/rm/rm.c b/src/user/app/rm/rm.c index b557e6f..c52c5b1 100644 --- a/src/user/app/rm/rm.c +++ b/src/user/app/rm/rm.c @@ -10,8 +10,7 @@ exit_code_t main(uint64_t argc, const char **argv) { uint64_t code = EXIT_CODE_OK; for (uint64_t i = 1; i < argc; i++) { - uint64_t removed = remove(argv[i]); - if (removed == (uint64_t)-1) { + if (remove(argv[i]) == (uint64_t)-1) { ERR_S("rm: could not remove file\n"); code = EXIT_CODE_GENERAL_FAILURE; } diff --git a/src/user/app/shell/shell.c b/src/user/app/shell/shell.c index 9553799..32b2b8c 100644 --- a/src/user/app/shell/shell.c +++ b/src/user/app/shell/shell.c @@ -96,7 +96,12 @@ static void execute(char *command) { uint8_t pids_count = 0; for (uint8_t i = 0; i < subcommands_count; i++) { - string_trim(subcommands[i], ' ', &subcommands[i]); + if (!string_trim(subcommands[i], ' ', &subcommands[i])) { + if (subcommands_count > 1) { + ERR_S("Syntax error.\n"); + } + break; + } char *argv[16]; uint8_t argc = (uint8_t)string_split(subcommands[i], ' ', 16, argv); @@ -166,7 +171,7 @@ exit_code_t main() { print_prompt(); char line[256]; - uint64_t offset; + uint64_t offset = 0; char chunk[64]; uint64_t received; diff --git a/src/user/app/wc/wc.c b/src/user/app/wc/wc.c index 36f20af..afb002e 100644 --- a/src/user/app/wc/wc.c +++ b/src/user/app/wc/wc.c @@ -6,7 +6,7 @@ #define BLOCK_SIZE 65536 exit_code_t pass(uint64_t fd) { - static char buffer[BLOCK_SIZE]; + char buffer[BLOCK_SIZE]; uint64_t bytes; uint64_t total = 0; while ((bytes = read(fd, BLOCK_SIZE, buffer))) {