diff --git a/stm/std.h b/stm/std.h index 41f477d26b..a2bf706176 100644 --- a/stm/std.h +++ b/stm/std.h @@ -13,7 +13,6 @@ void *memset(void *s, int c, size_t n); size_t strlen(const char *str); int strcmp(const char *s1, const char *s2); int strncmp(const char *s1, const char *s2, size_t n); -char *strndup(const char *s, size_t n); char *strcpy(char *dest, const char *src); char *strcat(char *dest, const char *src); char *strchr(const char *s, int c); diff --git a/stm/string0.c b/stm/string0.c index 79fd4cc097..61350bd972 100644 --- a/stm/string0.c +++ b/stm/string0.c @@ -78,17 +78,6 @@ int strncmp(const char *s1, const char *s2, size_t n) { else return 0; } -char *strndup(const char *s, size_t n) { - size_t len = strlen(s); - if (n > len) { - n = len; - } - char *s2 = malloc(n + 1); - memcpy(s2, s, n); - s2[n] = '\0'; - return s2; -} - char *strcpy(char *dest, const char *src) { char *d = dest; while (*src) { diff --git a/teensy/std.h b/teensy/std.h index 6b768e7c8d..7003e7be0b 100644 --- a/teensy/std.h +++ b/teensy/std.h @@ -13,7 +13,6 @@ void *memset(void *s, int c, size_t n); int strlen(const char *str); int strcmp(const char *s1, const char *s2); int strncmp(const char *s1, const char *s2, size_t n); -char *strndup(const char *s, size_t n); char *strcpy(char *dest, const char *src); char *strcat(char *dest, const char *src);