diff options
author | Julius Bünger <buenger@mytum.de> | 2019-02-21 22:04:11 +0100 |
---|---|---|
committer | Julius Bünger <buenger@mytum.de> | 2019-02-21 22:04:11 +0100 |
commit | 7ab9e38e6652cf9d4352e8cb6073a78a773b6579 (patch) | |
tree | a2c622011f2534800d0e23c76c1cdcae8f6d68a1 /src/rps/gnunet-service-rps.c | |
parent | 2911b37b421f9d8faf69e223cc0fa05db656ab3c (diff) | |
download | gnunet-7ab9e38e6652cf9d4352e8cb6073a78a773b6579.tar.gz gnunet-7ab9e38e6652cf9d4352e8cb6073a78a773b6579.zip |
RPS: Use #define instead of hardcoded numbers
Diffstat (limited to 'src/rps/gnunet-service-rps.c')
-rw-r--r-- | src/rps/gnunet-service-rps.c | 13 |
1 files 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 | |||
2928 | destroy_sub (struct Sub *sub) | 2928 | destroy_sub (struct Sub *sub) |
2929 | { | 2929 | { |
2930 | #ifdef TO_FILE | 2930 | #ifdef TO_FILE |
2931 | char push_recv_str[1536] = ""; /* 256 * 6 (1 whitespace, 1 comma, up to 4 chars) */ | 2931 | #define SIZE_DUMP_FILE 1536 /* 256 * 6 (1 whitespace, 1 comma, up to 4 chars) */ |
2932 | char pull_delays_str[1536] = ""; /* 256 * 6 (1 whitespace, 1 comma, up to 4 chars) */ | 2932 | char push_recv_str[SIZE_DUMP_FILE + 1] = ""; |
2933 | char pull_delays_str[SIZE_DUMP_FILE + 1] = ""; | ||
2933 | char *recv_str_iter; | 2934 | char *recv_str_iter; |
2934 | #endif /* TO_FILE */ | 2935 | #endif /* TO_FILE */ |
2935 | GNUNET_assert (NULL != sub); | 2936 | GNUNET_assert (NULL != sub); |
@@ -2976,7 +2977,9 @@ destroy_sub (struct Sub *sub) | |||
2976 | "\n"); | 2977 | "\n"); |
2977 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 2978 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
2978 | "Writing push stats to disk\n"); | 2979 | "Writing push stats to disk\n"); |
2979 | to_file_w_len (sub->file_name_push_recv, 1535, push_recv_str); | 2980 | to_file_w_len (sub->file_name_push_recv, |
2981 | SIZE_DUMP_FILE, | ||
2982 | push_recv_str); | ||
2980 | GNUNET_free (sub->file_name_push_recv); | 2983 | GNUNET_free (sub->file_name_push_recv); |
2981 | sub->file_name_push_recv = NULL; | 2984 | sub->file_name_push_recv = NULL; |
2982 | 2985 | ||
@@ -2997,7 +3000,9 @@ destroy_sub (struct Sub *sub) | |||
2997 | (void) stpcpy (recv_str_iter, | 3000 | (void) stpcpy (recv_str_iter, |
2998 | "\n"); | 3001 | "\n"); |
2999 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Writing pull delays to disk\n"); | 3002 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Writing pull delays to disk\n"); |
3000 | to_file_w_len (sub->file_name_pull_delays, 1535, pull_delays_str); | 3003 | to_file_w_len (sub->file_name_pull_delays, |
3004 | SIZE_DUMP_FILE, | ||
3005 | pull_delays_str); | ||
3001 | GNUNET_free (sub->file_name_pull_delays); | 3006 | GNUNET_free (sub->file_name_pull_delays); |
3002 | sub->file_name_pull_delays = NULL; | 3007 | sub->file_name_pull_delays = NULL; |
3003 | 3008 | ||