summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/util_str.c15
-rw-r--r--source4/librpc/idl/winreg.idl4
2 files changed, 17 insertions, 2 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.
**/
diff --git a/source4/librpc/idl/winreg.idl b/source4/librpc/idl/winreg.idl
index c7dc3942df..263946bdda 100644
--- a/source4/librpc/idl/winreg.idl
+++ b/source4/librpc/idl/winreg.idl
@@ -10,8 +10,8 @@
] interface winreg
{
typedef struct {
- [value(2*(strlen_m(r->name)+1))] uint16 name_len;
- [value(r->name_len)] uint16 name_size;
+ [value(strlen_m_term(r->name)*2)] uint16 name_len;
+ [value(r->name_len)] uint16 name_size;
unistr *name;
} winreg_String;