[collectd] [PATCH 2/2] utils_format_json: include ds names and types in json output.

Florian Forster octo at verplant.org
Wed Mar 24 17:59:41 CET 2010

Hi Chris,

On Tue, Mar 23, 2010 at 08:53:31PM -0700, Chris Buben wrote:
> Make it easier for external systems (i.e. those without visibility
> into types.db) to interpret collectd json data.

thanks for this patch, too :)

I've done a minor change here:

> +    BUFFER_ADD ("\"");
> +    BUFFER_ADD(ds->ds[i].name);
> +    BUFFER_ADD ("\"");

I've changed that to:

  BUFFER_ADD ("\"%s\"", ds->ds[i].name);

This reduces the calls to "snprintf" to one and prevents formatstring
attacks. Very unlikely, but I feel better with this code nonetheless ;)

Florian octo Forster
Hacker in training
GnuPG: 0x91523C3D
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20100324/f185d64c/attachment.pgp 

More information about the collectd mailing list