1 /* $Id: bts2str.c,v 1.9 1994/06/24 11:22:22 ceriel Exp $ */
3 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
4 * See the copyright notice in the ACK home directory, in the file "Copyright".
6 /* bts2str() turns a row of bytes b with length n into string s
7 The ASCII set of characters is used.
11 #include "ack_string.h"
13 #define is_print(c) ((unsigned)((c) - ' ') <= '~' - ' ')
20 register char *f = b, *t = s;
24 if (*f == '\\' || *f == '"') *t++ = '\\';
28 *t++ = ((*f >> 6) & 03) + '0';
29 *t++ = ((*f >> 3) & 07) + '0';
30 *t++ = (*f++ & 07) + '0';