From d94b024b73aeca06de417e0fd3c502495312a8b2 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sat, 7 Dec 2019 13:40:28 +0100 Subject: Added userspace libc and began userspace based shell --- src/userspace/mlibc/string/strdisp.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/userspace/mlibc/string/strdisp.c (limited to 'src/userspace/mlibc/string/strdisp.c') diff --git a/src/userspace/mlibc/string/strdisp.c b/src/userspace/mlibc/string/strdisp.c new file mode 100644 index 0000000..d793718 --- /dev/null +++ b/src/userspace/mlibc/string/strdisp.c @@ -0,0 +1,12 @@ +#include + +void strdisponce(char *str) +{ + for (size_t i = sizeof(str) + 2; i > 0; i--) str[i] = str[i - 1]; + str[0] = 0; +} + +void strdisp(char *str, int n) +{ + for (int i = 0; i < n; i++) strdisponce(str); +} \ No newline at end of file -- cgit v1.2.3