Mercurial > hg > th-libs
diff th_string.h @ 487:702c64a6c570
Add new string helper functions th_strndup_no0() and th_strndup_no0_trim()
to make copies of non-NUL terminated strings.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 19 Sep 2019 06:18:50 +0300 |
parents | bf984b494f07 |
children | ff3ebe22f6c5 |
line wrap: on
line diff
--- a/th_string.h Thu Sep 19 06:18:18 2019 +0300 +++ b/th_string.h Thu Sep 19 06:18:50 2019 +0300 @@ -95,6 +95,9 @@ char *th_strdup_trim(const char *src, const int flags); char *th_strndup_trim(const char *src, const size_t n, const int flags); +char *th_strndup_no0(const char *src, const size_t len); +char *th_strndup_no0_trim(const char *src, const size_t len, const int flags); + int th_strcasecmp(const char *haystack, const char *needle); int th_strncasecmp(const char *haystack, const char *needle, size_t n); char *th_strrcasecmp(char *haystack, const char *needle);