xref: /freebsd/sbin/ipf/libipf/printsbuf.c (revision 5ca8e32633c4ffbbcd6762e5888b6a4ba0708c6c)
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