Add strnlen() replacement needed for glob.c.

Only used if no glob() and no strnlen().
This commit is contained in:
Todd C. Miller
2015-05-26 13:55:18 -06:00
parent 04128f5985
commit 49d56f323e
6 changed files with 75 additions and 0 deletions

View File

@@ -431,6 +431,11 @@ __dso_public size_t sudo_strlcpy(char *dst, const char *src, size_t siz);
# undef strlcpy
# define strlcpy(_a, _b, _c) sudo_strlcpy((_a), (_b), (_c))
#endif /* HAVE_STRLCPY */
#if !defined(HAVE_GLOB) && !defined(HAVE_STRNLEN)
__dso_public size_t sudo_strnlen(char *str, size_t maxlen);
# undef strnlen
# define strnlen(_a, _b) sudo_strnlen((_a), (_b))
#endif /* !HAVE_GLOB && !HAVE_STRNLEN */
#ifndef HAVE_MEMRCHR
__dso_public void *sudo_memrchr(const void *s, int c, size_t n);
# undef memrchr