summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/radixsort.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libc/stdlib/radixsort.c')
-rw-r--r--src/lib/libc/stdlib/radixsort.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libc/stdlib/radixsort.c b/src/lib/libc/stdlib/radixsort.c
index 0b2ff27044..49d03b52d5 100644
--- a/src/lib/libc/stdlib/radixsort.c
+++ b/src/lib/libc/stdlib/radixsort.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: radixsort.c,v 1.8 2005/08/08 08:05:37 espie Exp $ */ 1/* $OpenBSD: radixsort.c,v 1.9 2007/09/02 15:19:17 deraadt Exp $ */
2/*- 2/*-
3 * Copyright (c) 1990, 1993 3 * Copyright (c) 1990, 1993
4 * The Regents of the University of California. All rights reserved. 4 * The Regents of the University of California. All rights reserved.
@@ -104,7 +104,7 @@ sradixsort(const u_char **a, int n, const u_char *tab, u_int endch)
104 if (n < THRESHOLD) 104 if (n < THRESHOLD)
105 simplesort(a, n, 0, tr, endch); 105 simplesort(a, n, 0, tr, endch);
106 else { 106 else {
107 if ((ta = malloc(n * sizeof(a))) == NULL) 107 if ((ta = calloc(n, sizeof(a))) == NULL)
108 return (-1); 108 return (-1);
109 r_sort_b(a, ta, n, 0, tr, endch); 109 r_sort_b(a, ta, n, 0, tr, endch);
110 free(ta); 110 free(ta);