summaryrefslogtreecommitdiff
path: root/src/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/string.c')
-rw-r--r--src/string.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/string.c b/src/string.c
index 30ccba6..07042ce 100644
--- a/src/string.c
+++ b/src/string.c
@@ -3,9 +3,18 @@
void *memset( void *s, int c, size_t n )
{
for( size_t i = 0; i < n; i++ ) {
- ((uint8_t *)s)[i] = c;
+ ((char *)s)[i] = c;
}
return s;
}
+size_t strlen( const char *s )
+{
+ size_t len;
+ const char *p = s;
+
+ for( len = 0; *p; len++, p++ );
+
+ return len;
+}