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