--- src/sbin/jscan/subs.c 2005/03/07 02:38:28 1.1 +++ src/sbin/jscan/subs.c 2005/03/07 05:05:04 1.2 @@ -211,4 +211,20 @@ type_to_name(int16_t rectype) return (str); } +void +stringout(FILE *fp, char c, int exact) +{ + if (c != '\\' && c != '\"' && isprint(c)) { + putc(c, fp); + } else if (exact == 0) { + putc('.', fp); + } else if (c == 0) { + fprintf(fp, "\\0"); + } else if (c == '\n') { + fprintf(fp, "\\n"); + } else { + fprintf(fp, "\\x%02x", (int)(unsigned char)c); + } +} +