[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] 03/04: RPS: Use #define instead of hardcoded numbe
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] 03/04: RPS: Use #define instead of hardcoded numbers |
Date: |
Thu, 21 Feb 2019 22:06:37 +0100 |
This is an automated email from the git hooks/post-receive script.
julius-buenger pushed a commit to branch master
in repository gnunet.
commit 7ab9e38e6652cf9d4352e8cb6073a78a773b6579
Author: Julius Bünger <address@hidden>
AuthorDate: Thu Feb 21 22:04:11 2019 +0100
RPS: Use #define instead of hardcoded numbers
---
src/rps/gnunet-service-rps.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c
index 6f7e350a6..05d5c91c3 100644
--- a/src/rps/gnunet-service-rps.c
+++ b/src/rps/gnunet-service-rps.c
@@ -2928,8 +2928,9 @@ static void
destroy_sub (struct Sub *sub)
{
#ifdef TO_FILE
- char push_recv_str[1536] = ""; /* 256 * 6 (1 whitespace, 1 comma, up to 4
chars) */
- char pull_delays_str[1536] = ""; /* 256 * 6 (1 whitespace, 1 comma, up to 4
chars) */
+#define SIZE_DUMP_FILE 1536 /* 256 * 6 (1 whitespace, 1 comma, up to 4 chars)
*/
+ char push_recv_str[SIZE_DUMP_FILE + 1] = "";
+ char pull_delays_str[SIZE_DUMP_FILE + 1] = "";
char *recv_str_iter;
#endif /* TO_FILE */
GNUNET_assert (NULL != sub);
@@ -2976,7 +2977,9 @@ destroy_sub (struct Sub *sub)
"\n");
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Writing push stats to disk\n");
- to_file_w_len (sub->file_name_push_recv, 1535, push_recv_str);
+ to_file_w_len (sub->file_name_push_recv,
+ SIZE_DUMP_FILE,
+ push_recv_str);
GNUNET_free (sub->file_name_push_recv);
sub->file_name_push_recv = NULL;
@@ -2997,7 +3000,9 @@ destroy_sub (struct Sub *sub)
(void) stpcpy (recv_str_iter,
"\n");
LOG (GNUNET_ERROR_TYPE_DEBUG, "Writing pull delays to disk\n");
- to_file_w_len (sub->file_name_pull_delays, 1535, pull_delays_str);
+ to_file_w_len (sub->file_name_pull_delays,
+ SIZE_DUMP_FILE,
+ pull_delays_str);
GNUNET_free (sub->file_name_pull_delays);
sub->file_name_pull_delays = NULL;
--
To stop receiving notification emails like this one, please contact
address@hidden