summaryrefslogtreecommitdiff
path: root/source/rpc_parse/parse_prs.c
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1998-12-09 16:28:04 +0000
committerLuke Leighton <lkcl@samba.org>1998-12-09 16:28:04 +0000
commitdacf5b152bf74cc3ee9a816911384a5eb0e77afa (patch)
tree33c4fea85c7427d7a9c9fb3045d1f23ee48613c6 /source/rpc_parse/parse_prs.c
parent501617307f3b9bbad76406d00b1bc82f5cb479a6 (diff)
downloadsamba-dacf5b152bf74cc3ee9a816911384a5eb0e77afa.tar.gz
adding some enumerate services code, client and server.
Diffstat (limited to 'source/rpc_parse/parse_prs.c')
-rw-r--r--source/rpc_parse/parse_prs.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/source/rpc_parse/parse_prs.c b/source/rpc_parse/parse_prs.c
index 75432627ab8..ef327f01a18 100644
--- a/source/rpc_parse/parse_prs.c
+++ b/source/rpc_parse/parse_prs.c
@@ -237,21 +237,22 @@ BOOL prs_unistr3(BOOL charmode, char *name, UNISTR3 *str, prs_struct *ps, int de
BOOL prs_unistr(char *name, prs_struct *ps, int depth, UNISTR *str)
{
char *q = mem_data(&(ps->data), ps->offset);
- int i = 0;
+ int i = -1;
uint8 *start = (uint8*)q;
if (q == NULL) return False;
- do
+ do
{
+ i++;
RW_SVAL(ps->io, q, str->buffer[i],0);
q += 2;
- i++;
-
- } while ((i < sizeof(str->buffer) / sizeof(str->buffer[0])) &&
+ }
+ while ((i < sizeof(str->buffer) / sizeof(str->buffer[0])) &&
(str->buffer[i] != 0));
- ps->offset += i*2;
+
+ ps->offset += (i+1)*2;
dump_data(5+depth, (char *)start, i * 2);