summaryrefslogtreecommitdiff
path: root/core/DHT.c
diff options
context:
space:
mode:
authorJeffail <ash.jeffs@gmail.com>2013-07-15 15:42:50 +0100
committerJeffail <ash.jeffs@gmail.com>2013-07-15 15:42:50 +0100
commit859f31c160634547ecea8a0c857d55a1e68d1cc9 (patch)
tree4f197a641a4fcb8b60519c44368265454fc7f48a /core/DHT.c
parent7674e6572647a6c44daf2f064ef3c489c9878722 (diff)
Just cleaning up as I read, no behaviour changes
Diffstat (limited to 'core/DHT.c')
-rw-r--r--core/DHT.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/core/DHT.c b/core/DHT.c
index 42869c49..ce2ce6f8 100644
--- a/core/DHT.c
+++ b/core/DHT.c
@@ -126,6 +126,7 @@ int client_in_list(Client_data * list, uint32_t length, uint8_t * client_id, IP_
126 { 126 {
127 memcpy(list[i].client_id, client_id, CLIENT_ID_SIZE); 127 memcpy(list[i].client_id, client_id, CLIENT_ID_SIZE);
128 } 128 }
129
129 for(j = 0; j < CLIENT_ID_SIZE; j++) 130 for(j = 0; j < CLIENT_ID_SIZE; j++)
130 { 131 {
131 132
@@ -768,7 +769,7 @@ int DHT_addfriend(uint8_t * client_id)
768 { 769 {
769 temp = malloc(sizeof(Friend)); 770 temp = malloc(sizeof(Friend));
770 } 771 }
771 if(num_friends > 0) 772 else
772 { 773 {
773 temp = realloc(friends_list, sizeof(Friend) * (num_friends + 1)); 774 temp = realloc(friends_list, sizeof(Friend) * (num_friends + 1));
774 } 775 }
@@ -782,8 +783,6 @@ int DHT_addfriend(uint8_t * client_id)
782 memcpy(friends_list[num_friends].client_id, client_id, CLIENT_ID_SIZE); 783 memcpy(friends_list[num_friends].client_id, client_id, CLIENT_ID_SIZE);
783 num_friends++; 784 num_friends++;
784 return 0; 785 return 0;
785
786
787} 786}
788 787
789 788