summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3e9d0ba)
raw | patch | inline | side by side (parent: 3e9d0ba)
author | Florian Forster <octo@collectd.org> | |
Tue, 7 Feb 2012 17:16:02 +0000 (18:16 +0100) | ||
committer | Florian Forster <octo@collectd.org> | |
Tue, 7 Feb 2012 17:16:02 +0000 (18:16 +0100) |
This may also fix an off-by-one error when the name is long enough. D'oh!
Change-Id: Ibc5a68f9bc93eed6366d074b55a7aca020bcf990
Change-Id: Ibc5a68f9bc93eed6366d074b55a7aca020bcf990
src/write_graphite.c | patch | blob | history |
diff --git a/src/write_graphite.c b/src/write_graphite.c
index cc4e38a3a7d69a695028e95a1f70c0afcd658bf3..fca40d1a478fc48639686185edb2e4a8491ea918 100644 (file)
--- a/src/write_graphite.c
+++ b/src/write_graphite.c
for (i = 0; i < dst_len; i++)
{
+ if (src[i] == 0)
+ {
+ dst[i] = 0;
+ break;
+ }
+
if ((src[i] == '.')
|| isspace ((int) src[i])
|| iscntrl ((int) src[i]))
dst[i] = escape_char;
else
dst[i] = src[i];
-
- if (src[i] == 0)
- break;
}
}