Merge remote-tracking branch 'origin/master'
[unleashed/lotheac.git] / usr / src / cmd / ipf / lib / common / printbuf.c
blob613293ae19b6a1bcd7cd417c0d39f06e8318dda3
1 /*
2 * Copyright (C) 1993-2001 by Darren Reed.
4 * See the IPFILTER.LICENCE file for details on licencing.
6 * $Id: printbuf.c,v 1.5.4.1 2004/12/09 19:41:22 darrenr Exp $
7 */
9 #include <ctype.h>
11 #include "ipf.h"
14 void printbuf(buf, len, zend)
15 char *buf;
16 int len, zend;
18 char *s, c;
19 int i;
21 for (s = buf, i = len; i; i--) {
22 c = *s++;
23 if (ISPRINT(c))
24 putchar(c);
25 else
26 printf("\\%03o", c);
27 if ((c == '\0') && zend)
28 break;