From d4dfcda78eeca4206965667a45f4f00f4e10457a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 20 Nov 2003 10:29:54 +0000 Subject: * fixed level2 of QueryUserInfo * added per-field testing of SetUserInfo * fixed strlen_m() (This used to be commit 26238b0f8a5752bb0f611c4aa492b964e419209a) --- source4/lib/util_str.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'source4/lib') diff --git a/source4/lib/util_str.c b/source4/lib/util_str.c index b220820104..285b0cc02e 100644 --- a/source4/lib/util_str.c +++ b/source4/lib/util_str.c @@ -1074,13 +1074,18 @@ size_t strlen_m(const char *s) { size_t count = 0; + if (!s) { + return 0; + } + while (*s && !(((unsigned char)s[0]) & 0x7F)) { s++; count++; } - if (!*s) - return; + if (!*s) { + return count; + } push_ucs2(NULL,tmpbuf,s, sizeof(tmpbuf), STR_TERMINATE); return count + strlen_w(tmpbuf); -- cgit