Compare commits

..

2 Commits

Author SHA1 Message Date
6fa0ea91bd fix: %n 2023-08-02 17:37:12 +02:00
4e15cb9ff1 add: write 2023-08-02 17:36:03 +02:00
2 changed files with 31 additions and 1 deletions

28
src/commands/write.🗿 Normal file
View File

@ -0,0 +1,28 @@
puterr(str)
{
local ptr = str;
loop
{
if ([ptr] == 0)
break;
err [ptr];
ptr++;
}
err '\n';
}
cmd_write(data, args)
{
local i = 0;
if ([data + LOCATION_LENGTH] == 0)
return 0;
loop
{
if (i == [data + LOCATION_LENGTH])
return 0;
puterr([[[data + LOCATION_ARRAY] + i] + MAP_VALUE]);
i++;
}
}

View File

@ -170,12 +170,14 @@ main()
cmd_delete(data, NULL);
else if (strcmp(cmd, "h") == 0)
cmd_help(data, NULL);
else if (strcmp(cmd, "w") == 0)
cmd_write(data, NULL);
else
error(data, "cmd not foud");
free(cmd);
}
i++;
}
free(cmd);
free(ranges);
}
}