summaryrefslogtreecommitdiff
path: root/source3/lib/util_str.c
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-11-19 17:07:59 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:15:55 -0500
commit30db93664c3fc6617d568e8fea0d3a11282fb123 (patch)
treea5680b96d6e8c4053c21f19ef45baf746c9921cb /source3/lib/util_str.c
parentbfad4421449d7f49287b1ebe81bf572c271f8fca (diff)
downloadsamba-30db93664c3fc6617d568e8fea0d3a11282fb123.tar.gz
samba-30db93664c3fc6617d568e8fea0d3a11282fb123.tar.bz2
samba-30db93664c3fc6617d568e8fea0d3a11282fb123.zip
r19786: My last checkin to winreg_StringBuf killed rpccli_winreg_EnumKeys against
W2k3. The server requires that size==0 in the [in] name. Somehow I get the feeling that something is badly wrong here.... I did not yet recreate the gen_ndr equivalent, see next mail. Volker (This used to be commit 016ddce12005bb0829bf050e4d4851852751b3e5)
Diffstat (limited to 'source3/lib/util_str.c')
-rw-r--r--source3/lib/util_str.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c
index 414a87a562..fc13b75cc5 100644
--- a/source3/lib/util_str.c
+++ b/source3/lib/util_str.c
@@ -1644,6 +1644,24 @@ size_t strlen_m_term(const char *s)
return strlen_m(s) + 1;
}
+/*
+ * Weird helper routine for the winreg pipe: If nothing is around, return 0,
+ * if a string is there, include the terminator.
+ */
+
+size_t strlen_m_term_null(const char *s)
+{
+ size_t len;
+ if (!s) {
+ return 0;
+ }
+ len = strlen_m(s);
+ if (len == 0) {
+ return 0;
+ }
+
+ return len+1;
+}
/**
Return a RFC2254 binary string representation of a buffer.
Used in LDAP filters.