From 0bf72b6e330a76bee502cb36c1cb80c46d47d33c Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Thu, 6 Oct 2005 17:48:03 +0000 Subject: r10781: merging eventlog and svcctl code from trunk (This used to be commit f10aa9fb84bfac4f1a22b74d63999668700ffaac) --- source3/rpc_parse/parse_misc.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/rpc_parse/parse_misc.c') diff --git a/source3/rpc_parse/parse_misc.c b/source3/rpc_parse/parse_misc.c index 8bbb97f226..26da87b280 100644 --- a/source3/rpc_parse/parse_misc.c +++ b/source3/rpc_parse/parse_misc.c @@ -830,6 +830,8 @@ void init_unistr2(UNISTR2 *str, const char *buf, enum unistr2_term_codes flags) if (buf) { /* We always null terminate the copy. */ len = strlen(buf) + 1; + if ( flags == UNI_STR_DBLTERMINATE ) + len++; } else { /* no buffer -- nothing to do */ str->uni_max_len = 0; @@ -859,6 +861,8 @@ void init_unistr2(UNISTR2 *str, const char *buf, enum unistr2_term_codes flags) if (flags == UNI_STR_TERMINATE || flags == UNI_MAXLEN_TERMINATE) { num_chars++; } + if ( flags == UNI_STR_DBLTERMINATE ) + num_chars += 2; } str->uni_max_len = num_chars; -- cgit