summaryrefslogtreecommitdiff
path: root/libcli
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-02-14 09:58:13 +1100
committerAndrew Tridgell <tridge@samba.org>2010-02-14 18:44:20 +1100
commit76a7382346f0c9d945adf39da19d69616e2463b3 (patch)
tree1b3fbff54a24b2fa39cc12ea505aa3da7354f18d /libcli
parentcebbc9a6f1a97aaee633b6eeb6d93faff6c0afb5 (diff)
downloadsamba-76a7382346f0c9d945adf39da19d69616e2463b3.tar.gz
samba-76a7382346f0c9d945adf39da19d69616e2463b3.tar.bz2
samba-76a7382346f0c9d945adf39da19d69616e2463b3.zip
lib: use TYPESAFE_QSORT() in lib/ and libcli/
Diffstat (limited to 'libcli')
-rw-r--r--libcli/security/secace.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/libcli/security/secace.c b/libcli/security/secace.c
index 7d87b1cd5e..8a73a6ab94 100644
--- a/libcli/security/secace.c
+++ b/libcli/security/secace.c
@@ -23,6 +23,7 @@
#include "includes.h"
#include "librpc/gen_ndr/ndr_security.h"
#include "libcli/security/dom_sid.h"
+#include "lib/util/tsort.h"
#define SEC_ACE_HEADER_SIZE (2 * sizeof(uint8_t) + sizeof(uint16_t) + sizeof(uint32_t))
@@ -257,7 +258,7 @@ void dacl_sort_into_canonical_order(struct security_ace *srclist, unsigned int n
return;
/* Sort so that non-inherited ACE's come first. */
- qsort( srclist, num_aces, sizeof(srclist[0]), QSORT_CAST nt_ace_inherit_comp);
+ TYPESAFE_QSORT(srclist, num_aces, nt_ace_inherit_comp);
/* Find the boundary between non-inherited ACEs. */
for (i = 0; i < num_aces; i++ ) {
@@ -270,12 +271,10 @@ void dacl_sort_into_canonical_order(struct security_ace *srclist, unsigned int n
/* i now points at entry number of the first inherited ACE. */
/* Sort the non-inherited ACEs. */
- if (i)
- qsort( srclist, i, sizeof(srclist[0]), QSORT_CAST nt_ace_canon_comp);
+ TYPESAFE_QSORT(srclist, i, nt_ace_canon_comp);
/* Now sort the inherited ACEs. */
- if (num_aces - i)
- qsort( &srclist[i], num_aces - i, sizeof(srclist[0]), QSORT_CAST nt_ace_canon_comp);
+ TYPESAFE_QSORT(&srclist[i], num_aces - i, nt_ace_canon_comp);
}