diff options
-rw-r--r-- | src/rps/gnunet-service-rps.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c index ccf54d1e2..375c93a67 100644 --- a/src/rps/gnunet-service-rps.c +++ b/src/rps/gnunet-service-rps.c | |||
@@ -2846,19 +2846,15 @@ new_sub (const struct GNUNET_HashCode *hash, | |||
2846 | { | 2846 | { |
2847 | char *tmp_filename_valid_peers; | 2847 | char *tmp_filename_valid_peers; |
2848 | char str_hash[105]; | 2848 | char str_hash[105]; |
2849 | uint32_t len_filename_valid_peers; | 2849 | |
2850 | 2850 | GNUNET_snprintf (str_hash, | |
2851 | (void) GNUNET_snprintf (str_hash, 105, GNUNET_h2s_full (hash)); | 2851 | strlen (str_hash), |
2852 | tmp_filename_valid_peers = GNUNET_strdup (sub->filename_valid_peers); | 2852 | GNUNET_h2s_full (hash)); |
2853 | GNUNET_free (sub->filename_valid_peers); | 2853 | tmp_filename_valid_peers = sub->filename_valid_peers; |
2854 | len_filename_valid_peers = strlen (tmp_filename_valid_peers) + 105; /* Len of full hash + 1 */ | 2854 | GNUNET_asprintf (&sub->filename_valid_peers, |
2855 | sub->filename_valid_peers = GNUNET_malloc (len_filename_valid_peers); | 2855 | "%s%s", |
2856 | strncat (sub->filename_valid_peers, | 2856 | tmp_filename_valid_peers, |
2857 | tmp_filename_valid_peers, | 2857 | str_hash); |
2858 | len_filename_valid_peers); | ||
2859 | strncat (sub->filename_valid_peers, | ||
2860 | str_hash, | ||
2861 | len_filename_valid_peers); | ||
2862 | GNUNET_free (tmp_filename_valid_peers); | 2858 | GNUNET_free (tmp_filename_valid_peers); |
2863 | } | 2859 | } |
2864 | sub->peer_map = GNUNET_CONTAINER_multipeermap_create (4, GNUNET_NO); | 2860 | sub->peer_map = GNUNET_CONTAINER_multipeermap_create (4, GNUNET_NO); |