summaryrefslogtreecommitdiff
path: root/librpc/ndr
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2016-12-31 12:45:51 +0000
committerRalph Boehme <slow@samba.org>2017-01-03 16:04:28 +0100
commitf46932abfcd6461f4aa61302312ba13f641fc3d7 (patch)
treed5a3cba4a8879f769123d4cc6f9c83d2c60bcd1d /librpc/ndr
parent577418c87ef7ead24bcc09149c5a54840b7bc287 (diff)
downloadsamba-f46932abfcd6461f4aa61302312ba13f641fc3d7.tar.gz
librpc: Use "all_zero" where appropriate
... Saves a few bytes of footprint Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
Diffstat (limited to 'librpc/ndr')
-rw-r--r--librpc/ndr/ndr_sec_helper.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/librpc/ndr/ndr_sec_helper.c b/librpc/ndr/ndr_sec_helper.c
index ea082d148dd..ecc05115d4b 100644
--- a/librpc/ndr/ndr_sec_helper.c
+++ b/librpc/ndr/ndr_sec_helper.c
@@ -128,13 +128,9 @@ size_t ndr_size_dom_sid(const struct dom_sid *sid, int flags)
size_t ndr_size_dom_sid28(const struct dom_sid *sid, int flags)
{
- struct dom_sid zero_sid;
-
if (!sid) return 0;
- ZERO_STRUCT(zero_sid);
-
- if (memcmp(&zero_sid, sid, sizeof(zero_sid)) == 0) {
+ if (all_zero((const uint8_t *)sid, sizeof(struct dom_sid))) {
return 0;
}
@@ -287,8 +283,6 @@ enum ndr_err_code ndr_pull_dom_sid0(struct ndr_pull *ndr, int ndr_flags, struct
*/
enum ndr_err_code ndr_push_dom_sid0(struct ndr_push *ndr, int ndr_flags, const struct dom_sid *sid)
{
- struct dom_sid zero_sid;
-
if (!(ndr_flags & NDR_SCALARS)) {
return NDR_ERR_SUCCESS;
}
@@ -297,9 +291,7 @@ enum ndr_err_code ndr_push_dom_sid0(struct ndr_push *ndr, int ndr_flags, const s
return NDR_ERR_SUCCESS;
}
- ZERO_STRUCT(zero_sid);
-
- if (memcmp(&zero_sid, sid, sizeof(zero_sid)) == 0) {
+ if (all_zero((const uint8_t *)sid, sizeof(struct dom_sid))) {
return NDR_ERR_SUCCESS;
}