xref: /freebsd/sbin/ipf/libipf/printsbuf.c (revision 1323ec571215a77ddd21294f0871979d5ad6b992)
1 /*	$FreeBSD$	*/
2 
3 /*
4  * Copyright (C) 2012 by Darren Reed.
5  *
6  * See the IPFILTER.LICENCE file for details on licencing.
7  *
8  * $Id$
9  */
10 
11 #ifdef	IPFILTER_SCAN
12 
13 #include <ctype.h>
14 #include <stdio.h>
15 #include "ipf.h"
16 #include "netinet/ip_scan.h"
17 
18 void
19 printsbuf(char *buf)
20 {
21 	u_char *s;
22 	int i;
23 
24 	for (s = (u_char *)buf, i = ISC_TLEN; i; i--, s++) {
25 		if (ISPRINT(*s))
26 			putchar(*s);
27 		else
28 			PRINTF("\\%o", *s);
29 	}
30 }
31 #else
32 void printsbuf(char *buf);
33 
34 void printsbuf(char *buf)
35 {
36 #if 0
37 	buf = buf;	/* gcc -Wextra */
38 #endif
39 }
40 #endif
41