Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8cb3ace92f | ||
|
|
46f0202222 |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 949 KiB |
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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))) {
|
||||
|
||||
Reference in New Issue
Block a user