xref: /titanic_50/usr/src/cmd/ipf/lib/common/printsbuf.c (revision 0bb073995ac5a95bd35f2dd790df1ea3d8c2d507)
1 /*
2  * Copyright (C) 1993-2005  by Darren Reed.
3  * See the IPFILTER.LICENCE file for details on licencing.
4  */
5 
6 #ifdef	IPFILTER_SCAN
7 
8 #include <ctype.h>
9 #include <stdio.h>
10 #include "ipf.h"
11 #include "netinet/ip_scan.h"
12 
13 void printsbuf(buf)
14 char *buf;
15 {
16 	u_char *s;
17 	int i;
18 
19 	for (s = (u_char *)buf, i = ISC_TLEN; i; i--, s++) {
20 		if (ISPRINT(*s))
21 			putchar(*s);
22 		else
23 			printf("\\%o", *s);
24 	}
25 }
26 
27 #endif
28