From cfb5d7d84c63d2b13e9d756a1c31b07a88c21e3f Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Sat, 5 Aug 2000 19:03:00 +0000 Subject: 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- (This used to be commit 34d4fb54c3121d31cb8b29193f71d5e7b5471cdc) --- source3/rpc_parse/parse_misc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (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 73ea4b10d2..1cc072b7b5 100644 --- a/source3/rpc_parse/parse_misc.c +++ b/source3/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; } -- cgit