diff options
Diffstat (limited to 'payloads/libpayload')
-rw-r--r-- | payloads/libpayload/include/string.h | 2 | ||||
-rw-r--r-- | payloads/libpayload/libc/string.c | 44 |
2 files changed, 0 insertions, 46 deletions
diff --git a/payloads/libpayload/include/string.h b/payloads/libpayload/include/string.h index f4ce41fce7..7762c36b67 100644 --- a/payloads/libpayload/include/string.h +++ b/payloads/libpayload/include/string.h @@ -47,8 +47,6 @@ int memcmp(const void *s1, const void *s2, size_t len); * @defgroup string String functions * @{ */ -size_t strnlen(const char *str, size_t maxlen); -size_t strlen(const char *str); int strcmp(const char *s1, const char *s2); int strncmp(const char *s1, const char *s2, size_t maxlen); int strcasecmp(const char *s1, const char *s2); diff --git a/payloads/libpayload/libc/string.c b/payloads/libpayload/libc/string.c index b3e1c8df0d..f9805e39bf 100644 --- a/payloads/libpayload/libc/string.c +++ b/payloads/libpayload/libc/string.c @@ -36,50 +36,6 @@ #include <errno.h> /** - * Calculate the length of a fixed-size string. - * - * @param str The input string. - * @param maxlen Return at most maxlen characters as length of the string. - * @return The length of the string, not including the final NUL character. - * The maximum length returned is maxlen. - */ -size_t strnlen(const char *str, size_t maxlen) -{ - size_t len = 0; - - /* NULL and empty strings have length 0. */ - if (!str) - return 0; - - /* Loop until we find a NUL character, or maxlen is reached. */ - while ((*str++ != '\0') && (len < maxlen)) - len++; - - return len; -} - -/** - * Calculate the length of a string. - * - * @param str The input string. - * @return The length of the string, not including the final NUL character. - */ -size_t strlen(const char *str) -{ - size_t len = 0; - - /* NULL and empty strings have length 0. */ - if (!str) - return 0; - - /* Loop until we find a NUL character. */ - while (*str++ != '\0') - len++; - - return len; -} - -/** * Compare two strings. * * @param s1 The first string. |