diff options
author | Luke Leighton <lkcl@samba.org> | 1997-10-29 19:05:34 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1997-10-29 19:05:34 +0000 |
commit | 520878fd1f440a7313cedb4827bdc81454d94d20 (patch) | |
tree | c189025afdeb3d7d4bd3d20eabfbb2b36dbb5cc2 /source3/smbparse.c | |
parent | 26f5e4f25cdfe41d77662224ec942cfffbb5a6fe (diff) | |
download | samba-520878fd1f440a7313cedb4827bdc81454d94d20.tar.gz samba-520878fd1f440a7313cedb4827bdc81454d94d20.tar.bz2 samba-520878fd1f440a7313cedb4827bdc81454d94d20.zip |
ipc.c ntclientpipe.c:
response to Bind Acknowledgment needs a lookup table for the PIPE string
(secondary address in RPC_HDR_BA structure).
smbparse.c util.c :
interesting problem, i think caused by us typecasting a uint16* buffer
to char*. found on a SPARC.
(This used to be commit 420408ee83902faa6cf871f26e93ad5efb483727)
Diffstat (limited to 'source3/smbparse.c')
-rw-r--r-- | source3/smbparse.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/source3/smbparse.c b/source3/smbparse.c index 25ddeb56a8..b238cd513b 100644 --- a/source3/smbparse.c +++ b/source3/smbparse.c @@ -207,7 +207,7 @@ creates a UNISTR structure. void make_unistr(UNISTR *str, char *buf) { /* store the string (null-terminated copy) */ - PutUniCode((char *)(str->buffer), buf); + struni2(str->buffer, buf); } /******************************************************************* @@ -216,6 +216,8 @@ XXXX NOTE: UNISTR structures NEED to be null-terminated. ********************************************************************/ char* smb_io_unistr(BOOL io, UNISTR *uni, char *q, char *base, int align, int depth) { + int i = 0; + if (uni == NULL) return NULL; DEBUG(5,("%s%04x smb_io_unistr\n", tab_depth(depth), PTR_DIFF(q, base))); @@ -223,16 +225,14 @@ char* smb_io_unistr(BOOL io, UNISTR *uni, char *q, char *base, int align, int de q = align_offset(q, base, align); - if (io) - { - /* io True indicates read _from_ the SMB buffer into the string */ - q += 2 * unistrcpy((char*)uni->buffer, q); - } - else + do { - /* io True indicates copy _from_ the string into SMB buffer */ - q += 2 * unistrcpy(q, (char*)uni->buffer); - } + RW_SVAL(io, q, uni->buffer[i], 0); q += 2; + i++; + + } while ((i < sizeof(uni->buffer) / sizeof(uni->buffer[0])) && + (uni->buffer[i] != 0)); + return q; } @@ -247,7 +247,7 @@ void make_unistr2(UNISTR2 *str, char *buf, int len) str->uni_str_len = len; /* store the string (null-terminated copy) */ - PutUniCode((char *)str->buffer, buf); + struni2(str->buffer, buf); } /******************************************************************* |