diff options
Diffstat (limited to 'source3/rpc_parse/parse_misc.c')
-rw-r--r-- | source3/rpc_parse/parse_misc.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/source3/rpc_parse/parse_misc.c b/source3/rpc_parse/parse_misc.c index e4b7578e67..da6ff2c7f6 100644 --- a/source3/rpc_parse/parse_misc.c +++ b/source3/rpc_parse/parse_misc.c @@ -458,19 +458,17 @@ void smb_io_buffer3(char *desc, BUFFER3 *buf3, prs_struct *ps, int depth) /******************************************************************* creates a BUFFER2 structure. ********************************************************************/ -void make_buffer2(BUFFER2 *str, uint8 *buf, int len) +void make_buffer2(BUFFER2 *str, const char *buf, int len) { ZERO_STRUCTP(str); - /* max buffer size (allocated size) */ + /* set up string lengths. */ str->buf_max_len = len; str->undoc = 0; - str->buf_len = buf != NULL ? len : 0; + str->buf_len = len; - if (buf != NULL) - { - memcpy(str->buffer, buf, MIN(str->buf_len, sizeof(str->buffer))); - } + /* store the string (wide chars) */ + ascii_to_unistr(str->buffer, buf, len); } /******************************************************************* |