diff options
Diffstat (limited to 'usr.sbin/ctm/ctm_scan')
-rw-r--r-- | usr.sbin/ctm/ctm_scan/Makefile | 18 | ||||
-rw-r--r-- | usr.sbin/ctm/ctm_scan/ctm_scan.c | 17 |
2 files changed, 28 insertions, 7 deletions
diff --git a/usr.sbin/ctm/ctm_scan/Makefile b/usr.sbin/ctm/ctm_scan/Makefile index 80f3144..6230e6d 100644 --- a/usr.sbin/ctm/ctm_scan/Makefile +++ b/usr.sbin/ctm/ctm_scan/Makefile @@ -1,5 +1,15 @@ - -PROG= ctm_scan -LDFLAGS+= -lmd -NOMAN= 1 +# +# ---------------------------------------------------------------------------- +# "THE BEER-WARE LICENSE" (Revision 42): +# <phk@login.dkuug.dk> wrote this file. As long as you retain this notice you +# can do whatever you want with this stuff. If we meet some day, and you think +# this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp +# ---------------------------------------------------------------------------- +# +# $Id$ +# +PROG= ctm_scan +LDADD+= -lmd +NOMAN= 1 +CFLAGS+= -Wall .include <bsd.prog.mk> diff --git a/usr.sbin/ctm/ctm_scan/ctm_scan.c b/usr.sbin/ctm/ctm_scan/ctm_scan.c index cf6e38e..623cd14 100644 --- a/usr.sbin/ctm/ctm_scan/ctm_scan.c +++ b/usr.sbin/ctm/ctm_scan/ctm_scan.c @@ -1,3 +1,14 @@ +/* + * ---------------------------------------------------------------------------- + * "THE BEER-WARE LICENSE" (Revision 42): + * <phk@login.dkuug.dk> wrote this file. As long as you retain this notice you + * can do whatever you want with this stuff. If we meet some day, and you think + * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp + * ---------------------------------------------------------------------------- + * + * $Id$ + * + */ #include <stdio.h> #include <unistd.h> #include <stdlib.h> @@ -11,9 +22,9 @@ int barf[256]; int -pstrcmp(char **p, char **q) +pstrcmp(const void *pp, const void *qq) { - return strcmp(*p,*q); + return strcmp(*(char **)pp,*(char **)qq); } int @@ -62,7 +73,7 @@ Do(char *path) } closedir(d); if(!nde) return 0; - qsort(pde,nde,sizeof *pde,pstrcmp); + qsort(pde,nde,sizeof *pde, pstrcmp); for(k=0;k<nde;k++) { strcpy(buf+bufp,pde[k]); free(pde[k]); |