aboutsummaryrefslogtreecommitdiff
path: root/src/hello/hello.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/hello/hello.c')
-rw-r--r--src/hello/hello.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/hello/hello.c b/src/hello/hello.c
index 5d0c7111b..b200846f5 100644
--- a/src/hello/hello.c
+++ b/src/hello/hello.c
@@ -157,12 +157,12 @@ GNUNET_HELLO_add_address (const struct GNUNET_HELLO_Address *address,
157 return 0; 157 return 0;
158 exp = GNUNET_TIME_absolute_hton (expiration); 158 exp = GNUNET_TIME_absolute_hton (expiration);
159 alen = htons ((uint16_t) address->address_length); 159 alen = htons ((uint16_t) address->address_length);
160 memcpy (target, address->transport_name, slen); 160 GNUNET_memcpy (target, address->transport_name, slen);
161 memcpy (&target[slen], &alen, sizeof (uint16_t)); 161 GNUNET_memcpy (&target[slen], &alen, sizeof (uint16_t));
162 slen += sizeof (uint16_t); 162 slen += sizeof (uint16_t);
163 memcpy (&target[slen], &exp, sizeof (struct GNUNET_TIME_AbsoluteNBO)); 163 GNUNET_memcpy (&target[slen], &exp, sizeof (struct GNUNET_TIME_AbsoluteNBO));
164 slen += sizeof (struct GNUNET_TIME_AbsoluteNBO); 164 slen += sizeof (struct GNUNET_TIME_AbsoluteNBO);
165 memcpy (&target[slen], address->address, address->address_length); 165 GNUNET_memcpy (&target[slen], address->address, address->address_length);
166 slen += address->address_length; 166 slen += address->address_length;
167 return slen; 167 return slen;
168} 168}
@@ -208,7 +208,7 @@ get_hello_address_size (const char *buf,
208 GNUNET_break_op (0); 208 GNUNET_break_op (0);
209 return 0; 209 return 0;
210 } 210 }
211 memcpy (&alen, pos, sizeof (uint16_t)); 211 GNUNET_memcpy (&alen, pos, sizeof (uint16_t));
212 alen = ntohs (alen); 212 alen = ntohs (alen);
213 *ralen = alen; 213 *ralen = alen;
214 slen += alen + sizeof (uint16_t) + sizeof (struct GNUNET_TIME_AbsoluteNBO); 214 slen += alen + sizeof (uint16_t) + sizeof (struct GNUNET_TIME_AbsoluteNBO);
@@ -269,7 +269,7 @@ GNUNET_HELLO_create (const struct GNUNET_CRYPTO_EddsaPublicKey *public_key,
269 hello->header.size = htons (sizeof (struct GNUNET_HELLO_Message) + used); 269 hello->header.size = htons (sizeof (struct GNUNET_HELLO_Message) + used);
270 hello->friend_only = htonl (friend_only); 270 hello->friend_only = htonl (friend_only);
271 hello->publicKey = *public_key; 271 hello->publicKey = *public_key;
272 memcpy (&hello[1], 272 GNUNET_memcpy (&hello[1],
273 buffer, 273 buffer,
274 used); 274 used);
275 return hello; 275 return hello;
@@ -312,7 +312,7 @@ GNUNET_HELLO_iterate_addresses (const struct GNUNET_HELLO_Message *msg,
312 if (return_modified) 312 if (return_modified)
313 { 313 {
314 ret = GNUNET_malloc (msize); 314 ret = GNUNET_malloc (msize);
315 memcpy (ret, 315 GNUNET_memcpy (ret,
316 msg, 316 msg,
317 msize); 317 msize);
318 } 318 }
@@ -332,8 +332,8 @@ GNUNET_HELLO_iterate_addresses (const struct GNUNET_HELLO_Message *msg,
332 GNUNET_free_non_null (ret); 332 GNUNET_free_non_null (ret);
333 return NULL; 333 return NULL;
334 } 334 }
335 /* need memcpy() due to possibility of misalignment */ 335 /* need GNUNET_memcpy() due to possibility of misalignment */
336 memcpy (&expire, 336 GNUNET_memcpy (&expire,
337 &inptr[esize - alen - sizeof (struct GNUNET_TIME_AbsoluteNBO)], 337 &inptr[esize - alen - sizeof (struct GNUNET_TIME_AbsoluteNBO)],
338 sizeof (struct GNUNET_TIME_AbsoluteNBO)); 338 sizeof (struct GNUNET_TIME_AbsoluteNBO));
339 address.address = &inptr[esize - alen]; 339 address.address = &inptr[esize - alen];
@@ -349,7 +349,7 @@ GNUNET_HELLO_iterate_addresses (const struct GNUNET_HELLO_Message *msg,
349 (NULL != ret) ) 349 (NULL != ret) )
350 { 350 {
351 /* copy address over */ 351 /* copy address over */
352 memcpy (woff, 352 GNUNET_memcpy (woff,
353 inptr, 353 inptr,
354 esize); 354 esize);
355 woff += esize; 355 woff += esize;
@@ -1021,7 +1021,7 @@ add_address_to_uri (void *cls,
1021 1021
1022 addr_dup = GNUNET_strdup (addr); 1022 addr_dup = GNUNET_strdup (addr);
1023 if (NULL != (pos = strstr (addr_dup, "_server"))) 1023 if (NULL != (pos = strstr (addr_dup, "_server")))
1024 memcpy (pos, 1024 GNUNET_memcpy (pos,
1025 client_str, 1025 client_str,
1026 strlen (client_str)); /* Replace all server addresses with client addresses */ 1026 strlen (client_str)); /* Replace all server addresses with client addresses */
1027 1027