Sync usage with man page.
[netbsd-mini2440.git] / dist / ipf / lib / printbuf.c
blob3b82e7a377862e055ad5fe75552a7ae98f934cec
1 /* $NetBSD$ */
3 /*
4 * Copyright (C) 2000-2004 by Darren Reed.
6 * See the IPFILTER.LICENCE file for details on licencing.
8 * Id: printbuf.c,v 1.5.4.2 2006/06/16 17:21:10 darrenr Exp
9 */
11 #include <ctype.h>
13 #include "ipf.h"
16 void printbuf(buf, len, zend)
17 char *buf;
18 int len, zend;
20 char *s, c;
21 int i;
23 for (s = buf, i = len; i; i--) {
24 c = *s++;
25 if (ISPRINT(c))
26 putchar(c);
27 else
28 printf("\\%03o", c);
29 if ((c == '\0') && zend)
30 break;