X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=server%2Fdata.c;h=edfd4c3d388c74d7236469c7cde3db0274c184d1;hb=ccdf0c8dfcd1330073e111b4ffc5c303042e7589;hp=ffd0b67d32d463898bf1e37f259bc4d9ad87b273;hpb=46c219c69676ea4e6f467692b7db6e48a708ab80;p=matches%2FMCTX3420.git diff --git a/server/data.c b/server/data.c index ffd0b67..edfd4c3 100644 --- a/server/data.c +++ b/server/data.c @@ -1,6 +1,6 @@ /** * @file data.c - * @purpose Implementation of data handling functions; saving, loading, displaying, selecting. + * @brief Implementation of data handling functions; saving, loading, displaying, selecting. */ #include "data.h" @@ -13,9 +13,8 @@ void Data_Init(DataFile * df) { // Everything is NULL - df->filename = NULL; + memset(df, 0, sizeof(DataFile)); pthread_mutex_init(&(df->mutex), NULL); - df->file = NULL; } /** @@ -162,13 +161,13 @@ void Data_PrintByIndexes(DataFile * df, int start_index, int end_index, DataForm switch (format) { case JSON: - fmt_string = "[%f,%f]"; + fmt_string = "[%.9f,%f]"; separator = ','; // For JSON we need an opening bracket FCGI_PrintRaw("["); break; case TSV: - fmt_string = "%f\t%f"; + fmt_string = "%.9f\t%f"; separator = '\n'; break; }