summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/init/stdlib.c6
-rw-r--r--src/init/stdlib.h2
2 files changed, 8 insertions, 0 deletions
diff --git a/src/init/stdlib.c b/src/init/stdlib.c
index ac80c28..56d6da6 100644
--- a/src/init/stdlib.c
+++ b/src/init/stdlib.c
@@ -13,6 +13,12 @@ int memcmp(const void *s1, const void *s2, size_t n) {
return 0;
}
+size_t strlen(const char *s) {
+ size_t c = 0;
+ while (*s++) c++;
+ return c;
+}
+
int printf(const char *fmt, ...) {
const char *seg = fmt; // beginning of the current segment
int total = 0;
diff --git a/src/init/stdlib.h b/src/init/stdlib.h
index 357a396..3e56beb 100644
--- a/src/init/stdlib.h
+++ b/src/init/stdlib.h
@@ -6,4 +6,6 @@
int memcmp(const void *s1, const void *s2, size_t n);
+size_t strlen(const char *s);
+
int printf(const char *fmt, ...);