summaryrefslogtreecommitdiff
path: root/testing/toxic/chat.c
diff options
context:
space:
mode:
Diffstat (limited to 'testing/toxic/chat.c')
-rw-r--r--testing/toxic/chat.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/testing/toxic/chat.c b/testing/toxic/chat.c
index 35be3bd3..1b5e743d 100644
--- a/testing/toxic/chat.c
+++ b/testing/toxic/chat.c
@@ -307,11 +307,13 @@ void execute(ToxWindow *self, ChatContext *ctx, Messenger *m, char *cmd)
307 } 307 }
308 308
309 else if (!strcmp(cmd, "/myid")) { 309 else if (!strcmp(cmd, "/myid")) {
310 char id[KEY_SIZE_BYTES*2+1] = {0}; 310 char id[FRIEND_ADDRESS_SIZE*2+1] = {0};
311 int i; 311 int i;
312 for (i = 0; i < KEY_SIZE_BYTES; i++) { 312 uint8_t address[FRIEND_ADDRESS_SIZE];
313 getaddress(m, address);
314 for (i = 0; i < FRIEND_ADDRESS_SIZE; i++) {
313 char xx[3]; 315 char xx[3];
314 snprintf(xx, sizeof(xx), "%02x", self_public_key[i] & 0xff); 316 snprintf(xx, sizeof(xx), "%02X", address[i] & 0xff);
315 strcat(id, xx); 317 strcat(id, xx);
316 } 318 }
317 wprintw(ctx->history, "Your ID: %s\n", id); 319 wprintw(ctx->history, "Your ID: %s\n", id);