summaryrefslogtreecommitdiffstats
path: root/contrib/ccan/json/test/common.h
blob: 328cb73c03d07b0c79ab0a247ff41bf24eaa15e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <ccan/json/json.c>
#include <ccan/tap/tap.h>

#include <errno.h>
#include <string.h>

static char *chomp(char *s)
{
	char *e;
	
	if (s == NULL || *s == 0)
		return s;
	
	e = strchr(s, 0);
	if (e[-1] == '\n')
		*--e = 0;
	return s;
}