summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeiko Schlittermann (HS12-RIPE) <hs@schlittermann.de>2016-03-02 00:14:28 +0100
committerHeiko Schlittermann (HS12-RIPE) <hs@schlittermann.de>2016-03-02 00:14:28 +0100
commit84bbb4d8164aae21a8e5418250359637d8aabc29 (patch)
tree6f13c603d57ed1379e5fee41dd648356e7fb1256
parent2478dbdfba7cf729ddee43a5a77bde8c25ccdede (diff)
Make qsort() in readconf.c more portable
-rw-r--r--src/src/functions.h2
-rw-r--r--src/src/readconf.c2
-rw-r--r--src/src/string.c4
3 files changed, 4 insertions, 4 deletions
diff --git a/src/src/functions.h b/src/src/functions.h
index a4c791f10..97af70cee 100644
--- a/src/src/functions.h
+++ b/src/src/functions.h
@@ -419,7 +419,7 @@ extern uschar *string_append_listele(uschar *, uschar, const uschar *);
extern uschar *string_append_listele_n(uschar *, uschar, const uschar *, unsigned);
extern uschar *string_base62(unsigned long int);
extern uschar *string_cat(uschar *, int *, int *, const uschar *, int);
-extern int string_compare_by_pointer(const uschar **, const uschar **);
+extern int string_compare_by_pointer(const void *, const void *);
extern uschar *string_copy_dnsdomain(uschar *);
extern uschar *string_copy_malloc(const uschar *);
extern uschar *string_copylc(const uschar *);
diff --git a/src/src/readconf.c b/src/src/readconf.c
index 92160c8f2..8844ca73a 100644
--- a/src/src/readconf.c
+++ b/src/src/readconf.c
@@ -2715,7 +2715,7 @@ if (type == NULL)
size_t n;
for (p = USS environ; *p; p++) ;
n = p - USS environ;
- qsort(environ, p - USS environ, sizeof(*p), (__compar_fn_t) string_compare_by_pointer);
+ qsort(environ, p - USS environ, sizeof(*p), string_compare_by_pointer);
for (p = USS environ; *p; p++)
{
diff --git a/src/src/string.c b/src/src/string.c
index 1c4ba121c..be5a8deda 100644
--- a/src/src/string.c
+++ b/src/src/string.c
@@ -1713,9 +1713,9 @@ for -bP environment output, needs a function to compare two pointers to string
pointers. Here it is. */
int
-string_compare_by_pointer(const uschar **a, const uschar **b)
+string_compare_by_pointer(const void *a, const void *b)
{
-return Ustrcmp(CUS *a, CUS *b);
+return Ustrcmp(CUSS *(const char**) a, CUSS *(const char**) b);
}
#endif /* COMPILE_UTILITY */