X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fwrite_log.c;h=3c599784bb835b20ad45a3772ef36acc3d41d8ae;hb=141816828389e3ad98f66db29b4a702479dcb05d;hp=db09849fefc75aa2691a8c663be40f885b63a0fb;hpb=5eb1fef6de7e0c8fb99e3d85063d96d7cc785f9b;p=collectd.git diff --git a/src/write_log.c b/src/write_log.c index db09849f..3c599784 100644 --- a/src/write_log.c +++ b/src/write_log.c @@ -26,6 +26,7 @@ **/ #include "collectd.h" + #include "common.h" #include "plugin.h" #include "configfile.h" @@ -38,7 +39,7 @@ static int wl_write_messages (const data_set_t *ds, const value_list_t *vl) { - char buffer[WL_BUF_SIZE]; + char buffer[WL_BUF_SIZE] = { 0 }; int status; if (0 != strcmp (ds->type, vl->type)) @@ -48,7 +49,6 @@ static int wl_write_messages (const data_set_t *ds, const value_list_t *vl) return -1; } - memset (buffer, 0, sizeof (buffer)); status = format_graphite (buffer, sizeof (buffer), ds, vl, NULL, NULL, '_', 0); if (status != 0) /* error message has been printed already. */