summaryrefslogtreecommitdiff
path: root/regress/lib/libc/vis/vis_test.c
blob: 40e5d9f50327a4aa30a591fd07a6e78ba3171fea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*	$OpenBSD */

/* Public domain. 2005, Otto Moerbeek */

#include <limits.h>
#include <stdlib.h>
#include <stdio.h>
#include <vis.h>

int
main()
{
	char inp[UCHAR_MAX + 1];
	char out[4 * UCHAR_MAX + 1];
	int i;

	for (i = 0; i <= UCHAR_MAX; i++) {
		inp[i] = i;
	}
	strvisx(out, inp, UCHAR_MAX + 1, 0);
	printf("%s\n", out);
	exit(0);
}