diff options
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/util_unistr.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/source3/lib/util_unistr.c b/source3/lib/util_unistr.c index e7c200218e..e90a824395 100644 --- a/source3/lib/util_unistr.c +++ b/source3/lib/util_unistr.c @@ -819,22 +819,25 @@ UNISTR2* ucs2_to_unistr2(TALLOC_CTX *ctx, UNISTR2* dst, smb_ucs2_t* src) { size_t len; - if (!src) return NULL; + if (!src) + return NULL; len = strlen_w(src); /* allocate UNISTR2 destination if not given */ if (!dst) { dst = (UNISTR2*) talloc(ctx, sizeof(UNISTR2)); - if (!dst) return NULL; + if (!dst) + return NULL; } if (!dst->buffer) { dst->buffer = (uint16*) talloc(ctx, sizeof(uint16) * (len + 1)); - if (!dst->buffer) return NULL; + if (!dst->buffer) + return NULL; } /* set UNISTR2 parameters */ dst->uni_max_len = len + 1; - dst->undoc = 0; + dst->offset = 0; dst->uni_str_len = len; /* copy the actual unicode string */ @@ -842,4 +845,3 @@ UNISTR2* ucs2_to_unistr2(TALLOC_CTX *ctx, UNISTR2* dst, smb_ucs2_t* src) return dst; } - |