diff options
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/util_str.c | 9 |
1 files changed, 7 insertions, 2 deletions
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); |