summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2003-11-23 10:50:52 +0000
committerTim Potter <tpot@samba.org>2003-11-23 10:50:52 +0000
commitc071301a77b1987526f42c8877336a1f6a1bfa7e (patch)
tree6664a2820f69608b555d4da5fe66cfa00744af7f /source4/lib
parent1b9452ffc5d21bcc621806273a1ab0366843451f (diff)
downloadsamba-c071301a77b1987526f42c8877336a1f6a1bfa7e.tar.gz
samba-c071301a77b1987526f42c8877336a1f6a1bfa7e.tar.bz2
samba-c071301a77b1987526f42c8877336a1f6a1bfa7e.zip
Add a strlen_m_term() function for returning the length of a string
including the termination. Using value(strlen_m((r->name)+1)*2) gives the wrong answer for the NULL string. (This used to be commit 7ae329e6630a07d29f83b6dd4572d26ab8a18c71)
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/util_str.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/source4/lib/util_str.c b/source4/lib/util_str.c
index 285b0cc02e..6005a3e49a 100644
--- a/source4/lib/util_str.c
+++ b/source4/lib/util_str.c
@@ -1092,6 +1092,21 @@ size_t strlen_m(const char *s)
}
/**
+ Work out the number of multibyte chars in a string, including the NULL
+ terminator.
+**/
+size_t strlen_m_term(const char *s)
+{
+ size_t count = 0;
+
+ if (!s) {
+ return 0;
+ }
+
+ return strlen_m(s) + 1;
+}
+
+/**
Convert a string to upper case.
**/