printsbuf.c revision 256281
1/* $FreeBSD: stable/10/contrib/ipfilter/lib/printsbuf.c 255332 2013-09-06 23:11:19Z cy $ */ 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 18void 19printsbuf(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 33void printsbuf(char *buf); 34 35void printsbuf(buf) 36 char *buf; 37{ 38#if 0 39 buf = buf; /* gcc -Wextra */ 40#endif 41} 42#endif 43