summaryrefslogtreecommitdiff
path: root/source/lib/util_unistr.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/lib/util_unistr.c')
-rw-r--r--source/lib/util_unistr.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/source/lib/util_unistr.c b/source/lib/util_unistr.c
index e7c200218e2..e90a824395c 100644
--- a/source/lib/util_unistr.c
+++ b/source/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;
}
-