diff options
author | Marvin Borner | 2020-11-22 19:22:31 +0100 |
---|---|---|
committer | Marvin Borner | 2020-11-22 19:22:31 +0100 |
commit | d82b18c90710baf16239257272a740488fddf11c (patch) | |
tree | 9a59f9c4eb16a5d5050d430f1946d9997ae5e6db /libc/str.c | |
parent | 608fcc4075c1f28207aa177ec2d9408cc3e5e0da (diff) |
Added file-based HTTP server
And fixed/added some other things
Diffstat (limited to 'libc/str.c')
-rw-r--r-- | libc/str.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -24,6 +24,16 @@ char *strcpy(char *dst, const char *src) return dst; } +char *strncpy(char *dst, const char *src, u32 n) +{ + char *q = dst; + + while (n-- && (*dst++ = *src++)) + ; + + return q; +} + int strcmp(const char *s1, const char *s2) { const u8 *c1 = (const u8 *)s1; @@ -73,6 +83,12 @@ char *strcat(char *dst, const char *src) return dst; } +char *strncat(char *dst, const char *src, u32 n) +{ + strncpy(strchr(dst, '\0'), src, n); + return dst; +} + char *strinv(char *s) { u32 s_str = strlen(s); |