From 871a4294043e2e74d906f63ad97a31e35abd0374 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 16 Mar 2001 03:25:13 +0000 Subject: added STR_ASCII support to clistr_pull() (This used to be commit 797293811ef0a79eecc460c471135c89090f8c06) --- source3/libsmb/clistr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source3/libsmb/clistr.c') diff --git a/source3/libsmb/clistr.c b/source3/libsmb/clistr.c index feed10fa4e..93361053e0 100644 --- a/source3/libsmb/clistr.c +++ b/source3/libsmb/clistr.c @@ -95,12 +95,13 @@ int clistr_pull(struct cli_state *cli, char *dest, const void *src, int dest_len dest_len = sizeof(pstring); } - if (clistr_align(cli->inbuf, src)) { + if (!(flags & STR_ASCII) && clistr_align(cli->inbuf, src)) { src++; if (src_len > 0) src_len--; } - if (!(flags & STR_UNICODE) && !(SVAL(cli->inbuf, smb_flg2) & FLAGS2_UNICODE_STRINGS)) { + if ((flags & STR_ASCII) || + (!(flags & STR_UNICODE) && !(SVAL(cli->inbuf, smb_flg2) & FLAGS2_UNICODE_STRINGS))) { /* the server doesn't want unicode */ if (flags & STR_TERMINATE) { safe_strcpy(dest, src, dest_len); -- cgit