summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-11-15 07:51:19 +0000
committerAndrew Tridgell <tridge@samba.org>2003-11-15 07:51:19 +0000
commitbcfbaa312a8493aa2b6ef76a7ebeee55625e5a9c (patch)
tree539a1fb803b4b762bad8fdbad9d1e6446d5240f0 /source4/lib
parent5a28ca7bf3250f951826aa0726e4487b88062abe (diff)
downloadsamba-bcfbaa312a8493aa2b6ef76a7ebeee55625e5a9c.tar.gz
samba-bcfbaa312a8493aa2b6ef76a7ebeee55625e5a9c.tar.bz2
samba-bcfbaa312a8493aa2b6ef76a7ebeee55625e5a9c.zip
run LookupDomain on each domain returned from EnumDomains in samr
(This used to be commit 947b9f8ced486d34ee6710a921fb985ea14e2bb1)
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/util_str.c20
1 files changed, 20 insertions, 0 deletions
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.
**/