diff options
author | Andrew Tridgell <tridge@samba.org> | 2001-02-20 23:52:27 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2001-02-20 23:52:27 +0000 |
commit | f76015333a80521aa3f2a06524e4cebd5c4bda1a (patch) | |
tree | 11f13820ca01f32356070dc0c468affd5bedc36a /source3/libsmb/clistr.c | |
parent | 064898cf8ad604c3d0a7399964b122d4c53fe7df (diff) | |
download | samba-f76015333a80521aa3f2a06524e4cebd5c4bda1a.tar.gz samba-f76015333a80521aa3f2a06524e4cebd5c4bda1a.tar.xz samba-f76015333a80521aa3f2a06524e4cebd5c4bda1a.zip |
yipee! client unicode now works well with nt
(This used to be commit 5b2ef8a1b914265c6072c968d2dad7d26c2aeffc)
Diffstat (limited to 'source3/libsmb/clistr.c')
-rw-r--r-- | source3/libsmb/clistr.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source3/libsmb/clistr.c b/source3/libsmb/clistr.c index 32168cae168..4c7c8e30772 100644 --- a/source3/libsmb/clistr.c +++ b/source3/libsmb/clistr.c @@ -40,17 +40,18 @@ is -1 then no maxiumum is used ****************************************************************************/ int clistr_push(struct cli_state *cli, void *dest, char *src, int dest_len, int flags) { - int len; + int len=0; /* treat a pstring as "unlimited" length */ if (dest_len == -1) { dest_len = sizeof(pstring); } - if (clistr_align(cli, PTR_DIFF(cli->outbuf, dest))) { + if (clistr_align(cli, PTR_DIFF(dest, cli->outbuf))) { *(char *)dest = 0; dest++; dest_len--; + len++; } if (!cli_use_unicode || !(cli->capabilities & CAP_UNICODE)) { @@ -72,7 +73,7 @@ int clistr_push(struct cli_state *cli, void *dest, char *src, int dest_len, int if (flags & CLISTR_UPPER) { strupper_w(dest); } - len = strlen(src)*2; + len += strlen(src)*2; if (flags & CLISTR_TERMINATE) len += 2; return len; } |