summaryrefslogtreecommitdiffstats
path: root/misc/valgrind-supp-extractor.c
blob: ce40a598e7c52d826e76e2cf0a44f190292f4a06 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <stdio.h>
int main (int argc, char ** argv) {
	char c = fgetc(stdin);
	int s = 0; /* 0: not in supp, 1: in supp */
	while (!feof(stdin)) {
		if (c == '{')
			s = 1;
		if (s)
			fputc(c, stdout);
		if (c == '}') {
			fputc('\n', stdout);
			s = 0;
		}
		c = fgetc(stdin);
	}
	fflush(stdout);
	return 0;
}