printsbuf.c revision 170268
1/*	$FreeBSD: head/contrib/ipfilter/lib/printsbuf.c 170268 2007-06-04 02:54:36Z darrenr $	*/
2
3/*
4 * Copyright (C) 2002-2004 by Darren Reed.
5 *
6 * See the IPFILTER.LICENCE file for details on licencing.
7 *
8 * $Id: printsbuf.c,v 1.2.4.2 2006/06/16 17:21:14 darrenr Exp $
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
18void printsbuf(buf)
19char *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
32#endif
33