summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@sernet.de>2008-09-03 14:22:48 +0200
committerVolker Lendecke <vl@samba.org>2008-09-03 14:47:48 +0200
commit84fca380f2040c53d20fff41972d2f4102183766 (patch)
tree512958098aaa2aa10ce486fafd7e5a41ffc6fb32 /source3
parent29dd253e696f9a2f94fc13f408996eca9ede8a7d (diff)
downloadsamba-84fca380f2040c53d20fff41972d2f4102183766.tar.gz
samba-84fca380f2040c53d20fff41972d2f4102183766.tar.bz2
samba-84fca380f2040c53d20fff41972d2f4102183766.zip
factor prs_append_some_data out of prs_append_some_prs_data
(This used to be commit 32cb45c962c822bd79a7d0f666f2f6037060b324)
Diffstat (limited to 'source3')
-rw-r--r--source3/include/proto.h2
-rw-r--r--source3/rpc_parse/parse_prs.c26
2 files changed, 19 insertions, 9 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index abfc79024a..291afac44d 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -7822,6 +7822,8 @@ uint32 prs_data_size(prs_struct *ps);
uint32 prs_offset(prs_struct *ps);
bool prs_set_offset(prs_struct *ps, uint32 offset);
bool prs_append_prs_data(prs_struct *dst, prs_struct *src);
+bool prs_append_some_data(prs_struct *dst, void *src_base, uint32_t start,
+ uint32_t len);
bool prs_append_some_prs_data(prs_struct *dst, prs_struct *src, int32 start, uint32 len);
bool prs_copy_data_in(prs_struct *dst, const char *src, uint32 len);
bool prs_copy_data_out(char *dst, prs_struct *src, uint32 len);
diff --git a/source3/rpc_parse/parse_prs.c b/source3/rpc_parse/parse_prs.c
index 072132f5ac..b3deb80c5d 100644
--- a/source3/rpc_parse/parse_prs.c
+++ b/source3/rpc_parse/parse_prs.c
@@ -395,18 +395,26 @@ bool prs_append_prs_data(prs_struct *dst, prs_struct *src)
Append some data from one parse_struct into another.
********************************************************************/
-bool prs_append_some_prs_data(prs_struct *dst, prs_struct *src, int32 start, uint32 len)
-{
- if (len == 0)
- return True;
+bool prs_append_some_data(prs_struct *dst, void *src_base, uint32_t start,
+ uint32_t len)
+{
+ if (len == 0) {
+ return true;
+ }
- if(!prs_grow(dst, len))
- return False;
-
- memcpy(&dst->data_p[dst->data_offset], src->data_p + start, (size_t)len);
+ if(!prs_grow(dst, len)) {
+ return false;
+ }
+
+ memcpy(&dst->data_p[dst->data_offset], src_base + start, (size_t)len);
dst->data_offset += len;
+ return true;
+}
- return True;
+bool prs_append_some_prs_data(prs_struct *dst, prs_struct *src, int32 start,
+ uint32 len)
+{
+ return prs_append_some_data(dst, src->data_p, start, len);
}
/*******************************************************************