diff --git a/str.c b/str.c index 7ce43f82..182a7842 100644 --- a/str.c +++ b/str.c @@ -123,6 +123,14 @@ char *str_toupper_inplace(char *str) return str; } +char *str_tolower_inplace(char *str) +{ + register char *s; + for (s = str; *s; ++s) + *s = tolower(*s); + return str; +} + const char *strnchr(const char *s, size_t n, char c) { for (; n; --n, ++s) { diff --git a/str.h b/str.h index d14b7f47..a02645ce 100644 --- a/str.h +++ b/str.h @@ -92,7 +92,9 @@ __STR_INLINE int hexvalue(char c) } int is_all_matching(const unsigned char *ptr, size_t len, unsigned char value); + char *str_toupper_inplace(char *s); +char *str_tolower_inplace(char *s); char *toprint(char *dstStr, ssize_t dstBufSiz, const char *srcBuf, size_t srcBytes, const char quotes[2]); char *toprint_str(char *dstStr, ssize_t dstBufSiz, const char *srcStr, const char quotes[2]);