Skip to content

Commit

Permalink
ad: replace ARRAY_SIZE with N_ELEMENTS
Browse files Browse the repository at this point in the history
ARRAY_SIZE is taken from the Samba header file memory.h which is not
available as a public header in newer Samba versions anymore. This patch
replaces it with an internal macro.

Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
  • Loading branch information
sumit-bose authored and jhrozek committed Feb 16, 2019
1 parent e32920a commit e1ff063
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/providers/ad/ad_gpo_ndr.c
Expand Up @@ -258,7 +258,7 @@ ndr_pull_dom_sid(struct ndr_pull *ndr,
NDR_CHECK(ndr_pull_align(ndr, 4));
NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sid_rev_num));
NDR_CHECK(ndr_pull_int8(ndr, NDR_SCALARS, &r->num_auths));
if (r->num_auths < 0 || r->num_auths > ARRAY_SIZE(r->sub_auths)) {
if (r->num_auths < 0 || r->num_auths > N_ELEMENTS(r->sub_auths)) {
return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
}
NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->id_auth, 6));
Expand Down

0 comments on commit e1ff063

Please sign in to comment.