projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
collectd.spec: add gps plugin
[collectd.git]
/
src
/
utils_format_graphite.c
diff --git
a/src/utils_format_graphite.c
b/src/utils_format_graphite.c
index
e23d5d9
..
e523420
100644
(file)
--- a/
src/utils_format_graphite.c
+++ b/
src/utils_format_graphite.c
@@
-22,12
+22,12
@@
**/
#include "collectd.h"
**/
#include "collectd.h"
+
#include "plugin.h"
#include "common.h"
#include "utils_format_graphite.h"
#include "utils_cache.h"
#include "plugin.h"
#include "common.h"
#include "utils_format_graphite.h"
#include "utils_cache.h"
-#include "utils_parse_option.h"
#define GRAPHITE_FORBIDDEN " \t\"\\:!/()\n\r"
#define GRAPHITE_FORBIDDEN " \t\"\\:!/()\n\r"
@@
-85,14
+85,12
@@
static int gr_format_values (char *ret, size_t ret_len,
static void gr_copy_escape_part (char *dst, const char *src, size_t dst_len,
char escape_char)
{
static void gr_copy_escape_part (char *dst, const char *src, size_t dst_len,
char escape_char)
{
- size_t i;
-
memset (dst, 0, dst_len);
if (src == NULL)
return;
memset (dst, 0, dst_len);
if (src == NULL)
return;
- for (i = 0; i < dst_len; i++)
+ for (
size_t
i = 0; i < dst_len; i++)
{
if (src[i] == 0)
{
{
if (src[i] == 0)
{
@@
-173,11
+171,9
@@
static int gr_format_name (char *ret, int ret_len,
static void escape_graphite_string (char *buffer, char escape_char)
{
static void escape_graphite_string (char *buffer, char escape_char)
{
- char *head;
-
assert (strchr(GRAPHITE_FORBIDDEN, escape_char) == NULL);
assert (strchr(GRAPHITE_FORBIDDEN, escape_char) == NULL);
- for (head = buffer + strcspn(buffer, GRAPHITE_FORBIDDEN);
+ for (
char *
head = buffer + strcspn(buffer, GRAPHITE_FORBIDDEN);
*head != '\0';
head += strcspn(head, GRAPHITE_FORBIDDEN))
*head = escape_char;
*head != '\0';
head += strcspn(head, GRAPHITE_FORBIDDEN))
*head = escape_char;
@@
-189,14
+185,13
@@
int format_graphite (char *buffer, size_t buffer_size,
unsigned int flags)
{
int status = 0;
unsigned int flags)
{
int status = 0;
- int i;
int buffer_pos = 0;
gauge_t *rates = NULL;
if (flags & GRAPHITE_STORE_RATES)
rates = uc_get_rate (ds, vl);
int buffer_pos = 0;
gauge_t *rates = NULL;
if (flags & GRAPHITE_STORE_RATES)
rates = uc_get_rate (ds, vl);
- for (i = 0; i < ds->ds_num; i++)
+ for (
size_t
i = 0; i < ds->ds_num; i++)
{
char const *ds_name = NULL;
char key[10*DATA_MAX_NAME_LEN];
{
char const *ds_name = NULL;
char key[10*DATA_MAX_NAME_LEN];