diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/lib.c | 8 | ||||
-rw-r--r-- | lib/lib.h | 1 |
2 files changed, 9 insertions, 0 deletions
@@ -887,3 +887,11 @@ int human_readable(char *buf, unsigned long long num) return end; } + +// The qsort man page says you can use alphasort, the posix committee +// disagreed, and doubled down: http://austingroupbugs.net/view.php?id=142 +// So just do our own. (The const is entirely to humor the stupid compiler.) +int qstrcmp(const void *a, const void *b) +{ + return strcmp(*(char **)a, *(char **)b); +} @@ -176,6 +176,7 @@ void base64_init(char *p); int terminal_size(unsigned *x, unsigned *y); int yesno(char *prompt, int def); int human_readable(char *buf, unsigned long long num); +int qstrcmp(const void *a, const void *b); // net.c int xsocket(int domain, int type, int protocol); |