From bcfbaa312a8493aa2b6ef76a7ebeee55625e5a9c Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 15 Nov 2003 07:51:19 +0000 Subject: run LookupDomain on each domain returned from EnumDomains in samr (This used to be commit 947b9f8ced486d34ee6710a921fb985ea14e2bb1) --- source4/lib/util_str.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'source4/lib') diff --git a/source4/lib/util_str.c b/source4/lib/util_str.c index f689ae4355..b220820104 100644 --- a/source4/lib/util_str.c +++ b/source4/lib/util_str.c @@ -1066,6 +1066,26 @@ void strupper_m(char *s) unix_strupper(s,strlen(s)+1,s,strlen(s)+1); } + +/** + work out the number of multibyte chars in a string +**/ +size_t strlen_m(const char *s) +{ + size_t count = 0; + + while (*s && !(((unsigned char)s[0]) & 0x7F)) { + s++; + count++; + } + + if (!*s) + return; + + push_ucs2(NULL,tmpbuf,s, sizeof(tmpbuf), STR_TERMINATE); + return count + strlen_w(tmpbuf); +} + /** Convert a string to upper case. **/ -- cgit