xref: /original-bsd/bin/ls/util.c (revision 00695d63)
1 /*
2  * Copyright (c) 1989, 1993, 1994
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * This code is derived from software contributed to Berkeley by
6  * Michael Fischbein.
7  *
8  * %sccs.include.redist.c%
9  */
10 
11 #ifndef lint
12 static char sccsid[] = "@(#)util.c	8.5 (Berkeley) 04/28/95";
13 #endif /* not lint */
14 
15 #include <sys/types.h>
16 #include <sys/stat.h>
17 
18 #include <ctype.h>
19 #include <fts.h>
20 #include <stdio.h>
21 #include <stdlib.h>
22 #include <string.h>
23 
24 #include "ls.h"
25 #include "extern.h"
26 
27 void
28 prcopy(src, dest, len)
29 	char *src, *dest;
30 	int len;
31 {
32 	int ch;
33 
34 	while (len--) {
35 		ch = *src++;
36 		*dest++ = isprint(ch) ? ch : '?';
37 	}
38 }
39 
40 void
41 usage()
42 {
43 	(void)fprintf(stderr,
44 	    "usage: ls [-1ACFLRTWacdfikloqrstu] [file ...]\n");
45 	exit(1);
46 }
47