summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2000-05-15 09:58:58 +0000
committerAndrew Tridgell <tridge@samba.org>2000-05-15 09:58:58 +0000
commitbb01686063812c5cdb206d19dd71bc082008d4ac (patch)
treed3cddd690cf4c78e373719906301681faa4873c7 /source3
parent1076cfd78f37e23df7a5f2d9787b74b529d607d3 (diff)
downloadsamba-bb01686063812c5cdb206d19dd71bc082008d4ac.tar.gz
samba-bb01686063812c5cdb206d19dd71bc082008d4ac.tar.bz2
samba-bb01686063812c5cdb206d19dd71bc082008d4ac.zip
update grow_size in prs_grow
(This used to be commit a42da205361bb70778913c8bd9facbb6b9a24937)
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_parse/parse_prs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/rpc_parse/parse_prs.c b/source3/rpc_parse/parse_prs.c
index efcd16470a..fff1bc27b1 100644
--- a/source3/rpc_parse/parse_prs.c
+++ b/source3/rpc_parse/parse_prs.c
@@ -44,7 +44,7 @@ void prs_dump(char *name, int v, prs_struct *ps)
if (fd != -1 || errno != EEXIST) break;
}
if (fd != -1) {
- write(fd, ps->data_p + ps->data_offset, ps->buffer_size - ps->data_offset);
+ write(fd, ps->data_p + ps->data_offset, ps->grow_size - ps->data_offset);
close(fd);
DEBUG(0,("created %s\n", fname));
}
@@ -163,6 +163,8 @@ BOOL prs_grow(prs_struct *ps, uint32 extra_space)
uint32 new_size;
char *new_data;
+ ps->grow_size = MAX(ps->grow_size, ps->data_offset + extra_space);
+
if(ps->data_offset + extra_space <= ps->buffer_size)
return True;