xref: /illumos-gate/usr/src/cmd/ipf/lib/common/printsbuf.c (revision ab25eeb5)
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 
printsbuf(buf)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