X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fcsv.c;h=0cb9bc1a319f9e33f1903f601266e6954c720f44;hb=dc6f54ccc87c5ae63d29f05eca91714ade689691;hp=07728734cc727ab0f8991480fd27c65298aabed1;hpb=6a68a39a2c6987fdcc94fb1bdd9cc8f598fd9478;p=collectd.git diff --git a/src/csv.c b/src/csv.c index 07728734..0cb9bc1a 100644 --- a/src/csv.c +++ b/src/csv.c @@ -45,7 +45,7 @@ static int value_list_to_string (char *buffer, int buffer_len, { int offset; int status; - int i; + size_t i; gauge_t *rates = NULL; assert (0 == strcmp (ds->type, vl->type)); @@ -187,7 +187,7 @@ static int value_list_to_filename (char *buffer, size_t buffer_size, static int csv_create_file (const char *filename, const data_set_t *ds) { FILE *csv; - int i; + size_t i; if (check_create_dir (filename)) return (-1); @@ -269,7 +269,7 @@ static int csv_write (const data_set_t *ds, const value_list_t *vl, char values[4096]; FILE *csv; int csv_fd; - struct flock fl; + struct flock fl = { 0 }; int status; if (0 != strcmp (ds->type, vl->type)) { @@ -342,9 +342,6 @@ static int csv_write (const data_set_t *ds, const value_list_t *vl, } csv_fd = fileno (csv); - memset (&fl, '\0', sizeof (fl)); - fl.l_start = 0; - fl.l_len = 0; /* till end of file */ fl.l_pid = getpid (); fl.l_type = F_WRLCK; fl.l_whence = SEEK_SET;