diff options
author | irungentoo <irungentoo@gmail.com> | 2013-07-15 08:16:38 -0700 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2013-07-15 08:16:38 -0700 |
commit | 619ecb0bb35f62d39afdc91b87f5c267f905ec0c (patch) | |
tree | 4f197a641a4fcb8b60519c44368265454fc7f48a /core/DHT.c | |
parent | 7674e6572647a6c44daf2f064ef3c489c9878722 (diff) | |
parent | 859f31c160634547ecea8a0c857d55a1e68d1cc9 (diff) |
Merge pull request #43 from Jeffail/master
Mostly superficial changes
Diffstat (limited to 'core/DHT.c')
-rw-r--r-- | core/DHT.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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 | ||