xref: /freebsd/sbin/ipf/libipf/printsbuf.c (revision ec0ea6efa1ad229d75c394c1a9b9cac33af2b1d3)
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(buf)
20 	char *buf;
21 {
22 	u_char *s;
23 	int i;
24 
25 	for (s = (u_char *)buf, i = ISC_TLEN; i; i--, s++) {
26 		if (ISPRINT(*s))
27 			putchar(*s);
28 		else
29 			PRINTF("\\%o", *s);
30 	}
31 }
32 #else
33 void printsbuf(char *buf);
34 
35 void printsbuf(buf)
36 	char *buf;
37 {
38 #if 0
39 	buf = buf;	/* gcc -Wextra */
40 #endif
41 }
42 #endif
43