lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 13 Mar 2014 21:07:33 +0100
From:	Andi Kleen <andi@...stfloor.org>
To:	Jiri Olsa <jolsa@...hat.com>
Cc:	Andi Kleen <andi@...stfloor.org>, acme@...radead.org,
	mingo@...nel.org, linux-kernel@...r.kernel.org,
	peterz@...radead.org, eranian@...gle.com, namhyung@...nel.org,
	Andi Kleen <ak@...ux.intel.com>
Subject: Re: [PATCH 1/8] perf, tools: Add jsmn `jasmine' JSON parser

On Tue, Mar 11, 2014 at 02:38:11PM +0100, Jiri Olsa wrote:
> On Wed, Mar 05, 2014 at 11:49:31AM -0800, Andi Kleen wrote:
> > From: Andi Kleen <ak@...ux.intel.com>
> > 
> 
> SNIP
> 
> > +jsmntok_t *parse_json(const char *fn, char **map, size_t *size, int *len)
> > +{
> > +	jsmn_parser parser;
> > +	jsmntok_t *tokens;
> > +	jsmnerr_t res;
> > +	unsigned sz;
> > +
> > +	*map = mapfile(fn, size);
> > +	if (!*map)
> > +		return NULL;
> > +	/* Heuristic */
> > +	sz = *size * 16;
> > +	tokens = malloc(sz);
> > +	if (!tokens)
> > +		goto error;
> > +	jsmn_init(&parser);
> > +	res = jsmn_parse(&parser, *map, *size, tokens,
> > +			 sz / sizeof(jsmntok_t));
> > +	if (res != JSMN_SUCCESS) {
> > +		fprintf(stderr, "%s: json error %d\n", fn, res);
> 
> use pr_err

dito.
-Andi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ