summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6ef3385)
raw | patch | inline | side by side (parent: 6ef3385)
author | Florian Forster <octo@collectd.org> | |
Wed, 24 Jul 2013 13:36:00 +0000 (15:36 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Wed, 24 Jul 2013 13:36:00 +0000 (15:36 +0200) |
D'oh! Thanks to @rcpoison for pointing this out!
Github: #380
Github: #380
src/rrdcached.c | patch | blob | history | |
src/rrdtool.c | patch | blob | history |
diff --git a/src/rrdcached.c b/src/rrdcached.c
index a8305e6345ef9979aeb5cde9b95566d4fa545659..33f05e737c579b179f3202080ca1256c5b64d3e0 100644 (file)
--- a/src/rrdcached.c
+++ b/src/rrdcached.c
if (datadir != NULL)
{
- size_t datadir_len = strlen (datadir);
+ size_t datadir_len = strlen (datadir) + 1;
if (datadir_len >= buffer_size)
return (ENOMEM);
sstrncpy (buffer, datadir, buffer_size);
+ buffer[datadir_len - 1] = '/';
+ buffer[datadir_len] = 0;
+
buffer += datadir_len;
buffer_size -= datadir_len;
}
diff --git a/src/rrdtool.c b/src/rrdtool.c
index a468867455fc0b011409d4cdcbc921f12116e040..0ffbd122aa30b03f31cf19900d9627875f121ac1 100644 (file)
--- a/src/rrdtool.c
+++ b/src/rrdtool.c
if (datadir != NULL)
{
- size_t datadir_len = strlen (datadir);
+ size_t datadir_len = strlen (datadir) + 1;
if (datadir_len >= buffer_size)
return (ENOMEM);
sstrncpy (buffer, datadir, buffer_size);
+ buffer[datadir_len - 1] = '/';
+ buffer[datadir_len] = 0;
+
buffer += datadir_len;
buffer_size -= datadir_len;
}