Compare commits

..
2 Commits
Author SHA1 Message Date
freywar 8cb3ace92f Add the most important part of README 2026-08-25 21:44:01 +03:00
freywar 46f0202222 Fix minor issues in user apps
Uninitialized variables, reading past array end, etc.
2026-08-25 21:41:25 +03:00
6 changed files with 11 additions and 6 deletions
+1
View File
@@ -0,0 +1 @@
![It works!](./WATCHME.png)
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 949 KiB

+1 -1
View File
@@ -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) {
+1 -2
View File
@@ -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;
}
+7 -2
View File
@@ -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;
+1 -1
View File
@@ -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))) {