From 4d48e84ffa6ec206f4bd6872e1f642f5cebc37f3 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 16 Nov 2003 05:07:07 +0000 Subject: slightly more efficient strlen setting in lsa and samr strings (calls strlen_m() once, not twice) (This used to be commit 468c2dc632703e6956428fb5f1da4044709b8f6f) --- source4/librpc/idl/lsa.idl | 2 +- source4/librpc/idl/samr.idl | 2 +- source4/librpc/ndr/ndr_samr.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source4/librpc/idl/lsa.idl b/source4/librpc/idl/lsa.idl index 204466c784..7209602728 100644 --- a/source4/librpc/idl/lsa.idl +++ b/source4/librpc/idl/lsa.idl @@ -26,7 +26,7 @@ typedef struct { [value(2*strlen_m(r->name))] uint16 name_len; - [value(2*strlen_m(r->name))] uint16 name_size; + [value(r->name_len)] uint16 name_size; unistr_noterm *name; } lsa_Name; diff --git a/source4/librpc/idl/samr.idl b/source4/librpc/idl/samr.idl index ec782acd01..e9aea5dbfe 100644 --- a/source4/librpc/idl/samr.idl +++ b/source4/librpc/idl/samr.idl @@ -39,7 +39,7 @@ /* Function: 0x05 */ typedef struct { [value(2*strlen_m(r->name))] uint16 name_len; - [value(2*strlen_m(r->name))] uint16 name_size; + [value(r->name_len)] uint16 name_size; unistr_noterm *name; } samr_Name; diff --git a/source4/librpc/ndr/ndr_samr.c b/source4/librpc/ndr/ndr_samr.c index fc42d56005..268d763383 100644 --- a/source4/librpc/ndr/ndr_samr.c +++ b/source4/librpc/ndr/ndr_samr.c @@ -43,7 +43,7 @@ static NTSTATUS ndr_push_samr_Name(struct ndr_push *ndr, int ndr_flags, struct s if (!(ndr_flags & NDR_SCALARS)) goto buffers; NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_uint16(ndr, 2*strlen_m(r->name))); - NDR_CHECK(ndr_push_uint16(ndr, 2*strlen_m(r->name))); + NDR_CHECK(ndr_push_uint16(ndr, r->name_len)); NDR_CHECK(ndr_push_ptr(ndr, r->name)); buffers: if (!(ndr_flags & NDR_BUFFERS)) goto done; -- cgit