summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJulius Bünger <buenger@mytum.de>2018-10-25 14:50:10 +0200
committerJulius Bünger <buenger@mytum.de>2018-10-29 18:05:48 +0100
commit1d59b2b7a532a0348198a91babbc841109b25935 (patch)
tree83abe97964fefb7ddfcc17be7c5cf386d7861d8f /src
parent978440fd8f5d44114fa538e75eed74c65ef4b957 (diff)
RPS service: separate values with newline when writing to file
Diffstat (limited to 'src')
-rw-r--r--src/rps/gnunet-service-rps.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c
index 6d7f06090..c7217351f 100644
--- a/src/rps/gnunet-service-rps.c
+++ b/src/rps/gnunet-service-rps.c
@@ -2901,7 +2901,7 @@ destroy_sub (struct Sub *sub)
for (uint32_t i = 0; i < 256; i++)
{
char push_recv_str_tmp[8];
- (void) snprintf (push_recv_str_tmp, 8, "%" PRIu32 ", ", sub->push_recv[i]);
+ (void) snprintf (push_recv_str_tmp, 8, "%" PRIu32 "\n", sub->push_recv[i]);
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Adding str `%s' to `%s'\n",
push_recv_str_tmp,
@@ -2910,6 +2910,9 @@ destroy_sub (struct Sub *sub)
push_recv_str_tmp,
1535 - strnlen (push_recv_str, 1536));
}
+ (void) strncat (push_recv_str,
+ "\n",
+ 1535 - strnlen (push_recv_str, 1536));
LOG (GNUNET_ERROR_TYPE_DEBUG, "Writing push stats to disk\n");
to_file_w_len (sub->file_name_push_recv, 1535, push_recv_str);
GNUNET_free (sub->file_name_push_recv);
@@ -2919,7 +2922,7 @@ destroy_sub (struct Sub *sub)
for (uint32_t i = 0; i < 256; i++)
{
char pull_delays_str_tmp[8];
- (void) snprintf (pull_delays_str_tmp, 8, "%" PRIu32 ", ", sub->pull_delays[i]);
+ (void) snprintf (pull_delays_str_tmp, 8, "%" PRIu32 "\n", sub->pull_delays[i]);
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Adding str `%s' to `%s'\n",
pull_delays_str_tmp,
@@ -2928,6 +2931,9 @@ destroy_sub (struct Sub *sub)
pull_delays_str_tmp,
1535 - strnlen (pull_delays_str, 1536));
}
+ (void) strncat (pull_delays_str,
+ "\n",
+ 1535 - strnlen (pull_delays_str, 1536));
LOG (GNUNET_ERROR_TYPE_DEBUG, "Writing pull delays to disk\n");
to_file_w_len (sub->file_name_pull_delays, 1535, pull_delays_str);
GNUNET_free (sub->file_name_pull_delays);