summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 401fa75)
raw | patch | inline | side by side (parent: 401fa75)
author | Florian Forster <octo@collectd.org> | |
Wed, 24 Jul 2013 12:12:53 +0000 (14:12 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Wed, 24 Jul 2013 12:41:30 +0000 (14:41 +0200) |
src/rrdcached.c | patch | blob | history | |
src/rrdtool.c | patch | blob | history |
diff --git a/src/rrdcached.c b/src/rrdcached.c
index cf23803138dec2bb8ee59cc8a6819785a72c5fb8..a8305e6345ef9979aeb5cde9b95566d4fa545659 100644 (file)
--- a/src/rrdcached.c
+++ b/src/rrdcached.c
int status;
size_t len;
+ if (datadir != NULL)
+ {
+ size_t datadir_len = strlen (datadir);
+
+ if (datadir_len >= buffer_size)
+ return (ENOMEM);
+
+ sstrncpy (buffer, datadir, buffer_size);
+ buffer += datadir_len;
+ buffer_size -= datadir_len;
+ }
+
status = FORMAT_VL (buffer, buffer_size, vl);
if (status != 0)
return (status);
diff --git a/src/rrdtool.c b/src/rrdtool.c
index 916ce01d65f03585341eab2fd0ab3cae70669dd4..a468867455fc0b011409d4cdcbc921f12116e040 100644 (file)
--- a/src/rrdtool.c
+++ b/src/rrdtool.c
/**
* collectd - src/rrdtool.c
- * Copyright (C) 2006-2008 Florian octo Forster
+ * Copyright (C) 2006-2013 Florian octo Forster
* Copyright (C) 2008-2008 Sebastian Harl
* Copyright (C) 2009 Mariusz Gronczewski
*
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* Authors:
- * Florian octo Forster <octo at verplant.org>
+ * Florian octo Forster <octo at collectd.org>
* Sebastian Harl <sh at tokkee.org>
* Mariusz Gronczewski <xani666 at gmail.com>
**/
int status;
size_t len;
+ if (datadir != NULL)
+ {
+ size_t datadir_len = strlen (datadir);
+
+ if (datadir_len >= buffer_size)
+ return (ENOMEM);
+
+ sstrncpy (buffer, datadir, buffer_size);
+ buffer += datadir_len;
+ buffer_size -= datadir_len;
+ }
+
status = FORMAT_VL (buffer, buffer_size, vl);
if (status != 0)
return (status);