summaryrefslogtreecommitdiffstats
path: root/source/rpc_parse/parse_misc.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2000-08-05 19:03:00 +0000
committerGerald Carter <jerry@samba.org>2000-08-05 19:03:00 +0000
commit34d4fb54c3121d31cb8b29193f71d5e7b5471cdc (patch)
treefd5d97fa799d4695b5b0a3798de52573e5bcd758 /source/rpc_parse/parse_misc.c
parent4ecd15cd5851e94808756e3da0ce6a066f0a0cd7 (diff)
downloadsamba-34d4fb54c3121d31cb8b29193f71d5e7b5471cdc.tar.gz
samba-34d4fb54c3121d31cb8b29193f71d5e7b5471cdc.tar.xz
samba-34d4fb54c3121d31cb8b29193f71d5e7b5471cdc.zip
removed the for() loop to copy the buffer in init_unistr2_from_unistr()
Replaced with a memcpy() Forgot to commit this a few moments ago j-
Diffstat (limited to 'source/rpc_parse/parse_misc.c')
-rw-r--r--source/rpc_parse/parse_misc.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/source/rpc_parse/parse_misc.c b/source/rpc_parse/parse_misc.c
index 73ea4b10d27..1cc072b7b58 100644
--- a/source/rpc_parse/parse_misc.c
+++ b/source/rpc_parse/parse_misc.c
@@ -906,13 +906,12 @@ void init_unistr2_from_unistr (UNISTR2 *to, UNISTR *from)
if (!parse_misc_talloc)
parse_misc_talloc = talloc_init();
+ /* copy the string now */
to->buffer = (uint16 *)talloc(parse_misc_talloc, sizeof(uint16)*(to->uni_str_len));
if (to->buffer == NULL)
smb_panic("init_unistr2_from_unistr: malloc fail\n");
- for (i=0; i < to->uni_str_len; i++)
- to->buffer[i] = from->buffer[i];
-
+ memcpy( to->buffer, from->buffer, to->uni_str_len*sizeof(uint16) );
return;
}