diff options
-rw-r--r-- | core/Messenger.c | 6 | ||||
-rw-r--r-- | testing/nTox_win32.c | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/core/Messenger.c b/core/Messenger.c index f77b4491..4c76dd30 100644 --- a/core/Messenger.c +++ b/core/Messenger.c | |||
@@ -71,6 +71,12 @@ int getfriend_id(uint8_t *client_id) | |||
71 | return -1; | 71 | return -1; |
72 | } | 72 | } |
73 | 73 | ||
74 | /* Returns number of friends */ | ||
75 | int getnumfriends() | ||
76 | { | ||
77 | return numfriends; | ||
78 | } | ||
79 | |||
74 | /* copies the public key associated to that friend id into client_id buffer. | 80 | /* copies the public key associated to that friend id into client_id buffer. |
75 | make sure that client_id is of size CLIENT_ID_SIZE. | 81 | make sure that client_id is of size CLIENT_ID_SIZE. |
76 | return 0 if success | 82 | return 0 if success |
diff --git a/testing/nTox_win32.c b/testing/nTox_win32.c index 6faae31d..9e9a5b1a 100644 --- a/testing/nTox_win32.c +++ b/testing/nTox_win32.c | |||
@@ -137,11 +137,11 @@ void line_eval(char* line) | |||
137 | } | 137 | } |
138 | 138 | ||
139 | else if (line[1] == 'l') { | 139 | else if (line[1] == 'l') { |
140 | printf("\n[i] Friend List\n\n"); | 140 | printf("\n[i] Friend List - %d\n\n", getnumfriends()); |
141 | 141 | ||
142 | int i; | 142 | int i; |
143 | 143 | ||
144 | for (i=0; i <= num_requests; i++) { | 144 | for (i=0; i < getnumfriends(); i++) { |
145 | char name[MAX_NAME_LENGTH]; | 145 | char name[MAX_NAME_LENGTH]; |
146 | getname(i, (uint8_t*)name); | 146 | getname(i, (uint8_t*)name); |
147 | printf("[%d] %s\n\n", i, (uint8_t*)name); | 147 | printf("[%d] %s\n\n", i, (uint8_t*)name); |