mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Merge branch 'master' of https://github.com/naxuroqa/ProjectTox-Core into pr
This commit is contained in:
commit
9fb82fc3bf
|
@ -52,28 +52,15 @@ uint8_t num_requests = 0;
|
||||||
|
|
||||||
void get_id(Messenger *m, char *data)
|
void get_id(Messenger *m, char *data)
|
||||||
{
|
{
|
||||||
char idstring0[200];
|
sprintf(data, "[i] ID: ");
|
||||||
char idstring1[FRIEND_ADDRESS_SIZE][5];
|
int offset = strlen(data);
|
||||||
char idstring2[FRIEND_ADDRESS_SIZE][5];
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
uint8_t address[FRIEND_ADDRESS_SIZE];
|
uint8_t address[FRIEND_ADDRESS_SIZE];
|
||||||
getaddress(m, address);
|
getaddress(m, address);
|
||||||
for(i = 0; i < FRIEND_ADDRESS_SIZE; i++)
|
for(; i < FRIEND_ADDRESS_SIZE; i++)
|
||||||
{
|
{
|
||||||
if (address[i] < (FRIEND_ADDRESS_SIZE / 2))
|
sprintf(data + 2*i + offset, "%02X ", address[i]);
|
||||||
strcpy(idstring1[i],"0");
|
|
||||||
else
|
|
||||||
strcpy(idstring1[i], "");
|
|
||||||
sprintf(idstring2[i], "%hhX",address[i]);
|
|
||||||
}
|
}
|
||||||
strcpy(idstring0,"[i] ID: ");
|
|
||||||
int j = 0;
|
|
||||||
for (j = 0; j < FRIEND_ADDRESS_SIZE; j++) {
|
|
||||||
strcat(idstring0,idstring1[j]);
|
|
||||||
strcat(idstring0,idstring2[j]);
|
|
||||||
}
|
|
||||||
|
|
||||||
memcpy(data, idstring0, strlen(idstring0));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void new_lines(char *line)
|
void new_lines(char *line)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user