summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2010-10-31 02:02:16 +0200
committerKarolin Seeger <kseeger@samba.org>2011-03-05 14:34:31 +0100
commit43e78d0b46529955bc8e66e6d4f127dbfe35904d (patch)
tree2ea8fb5c2e43cc6c3e8323e00d67100d5b348ba1 /source3/lib
parentb873b8b061cbbff578c242e2a062bd198a5069b3 (diff)
downloadsamba-43e78d0b46529955bc8e66e6d4f127dbfe35904d.tar.gz
s3:lib/util_str: add strlen_m_ext_term() - variant of strlen_m_ext() counting terminator
(cherry picked from commit f7928a0e0b2be27e83bf26644c45ac554c5acec2)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/util_str.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c
index f0eb6e55715..3da2b834d20 100644
--- a/source3/lib/util_str.c
+++ b/source3/lib/util_str.c
@@ -1521,6 +1521,14 @@ size_t strlen_m_ext(const char *s, const charset_t dst_charset)
return count;
}
+size_t strlen_m_ext_term(const char *s, const charset_t dst_charset)
+{
+ if (!s) {
+ return 0;
+ }
+ return strlen_m_ext(s, dst_charset) + 1;
+}
+
/**
Count the number of UCS2 characters in a string. Normally this will
be the same as the number of bytes in a string for single byte strings,