Files
netbsd/external/bsd/ipf/dist/lib/printsbuf.c
2013-04-06 16:48:33 +02:00

41 lines
635 B
C

/* $NetBSD: printsbuf.c,v 1.2 2012/07/22 14:27:37 darrenr Exp $ */
/*
* Copyright (C) 2012 by Darren Reed.
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: printsbuf.c,v 1.1.1.2 2012/07/22 13:44:42 darrenr Exp $
*/
#ifdef IPFILTER_SCAN
#include <ctype.h>
#include <stdio.h>
#include "ipf.h"
#include "netinet/ip_scan.h"
void
printsbuf(buf)
char *buf;
{
u_char *s;
int i;
for (s = (u_char *)buf, i = ISC_TLEN; i; i--, s++) {
if (ISPRINT(*s))
putchar(*s);
else
PRINTF("\\%o", *s);
}
}
#else
void printsbuf(char *buf);
void printsbuf(buf)
char *buf;
{
buf = buf; /* gcc -Wextra */
}
#endif