diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2009-01-17 22:06:45 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2009-01-17 22:06:45 +0000 |
commit | 7fa4ddd339f6387f22f417663d62a3a100ca2565 (patch) | |
tree | 41498c09ad455de1cd41dc2c87004829c19280db /bin/ksh/table.c | |
parent | e53a83f95418337d04f6cc3057f52e2053e34bab (diff) |
Use libc qsort instead of private version. Tested by several people.
Diffstat (limited to 'bin/ksh/table.c')
-rw-r--r-- | bin/ksh/table.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/bin/ksh/table.c b/bin/ksh/table.c index 7de3091feba..5f052c9bafc 100644 --- a/bin/ksh/table.c +++ b/bin/ksh/table.c @@ -1,4 +1,4 @@ -/* $OpenBSD: table.c,v 1.12 2005/12/11 20:31:21 otto Exp $ */ +/* $OpenBSD: table.c,v 1.13 2009/01/17 22:06:44 millert Exp $ */ /* * dynamic hashed associative table for commands and variables @@ -9,7 +9,7 @@ #define INIT_TBLS 8 /* initial table size (power of 2) */ static void texpand(struct table *, int); -static int tnamecmp(void *, void *); +static int tnamecmp(const void *, const void *); unsigned int @@ -154,9 +154,11 @@ ktnext(struct tstate *ts) } static int -tnamecmp(void *p1, void *p2) +tnamecmp(const void *p1, const void *p2) { - return strcmp(((struct tbl *)p1)->name, ((struct tbl *)p2)->name); + char *name1 = (*(struct tbl **)p1)->name; + char *name2 = (*(struct tbl **)p2)->name; + return strcmp(name1, name2); } struct tbl ** |