projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3e9d0ba
)
write_graphite plugin: Fix trailing underscores.
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
src/write_graphite.c
patch
|
blob
|
history
diff --git
a/src/write_graphite.c
b/src/write_graphite.c
index
cc4e38a
..
fca40d1
100644
(file)
--- a/
src/write_graphite.c
+++ b/
src/write_graphite.c
@@
-364,15
+364,18
@@
static void wg_copy_escape_part (char *dst, const char *src, size_t dst_len,
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;
}
}