diff options
-rw-r--r-- | util.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -2,6 +2,7 @@ | |||
2 | #include <string.h> | 2 | #include <string.h> |
3 | #include <tox/tox.h> | 3 | #include <tox/tox.h> |
4 | #include <stdio.h> | 4 | #include <stdio.h> |
5 | #include <stdlib.h> | ||
5 | 6 | ||
6 | void writechecksum(uint8_t *address) | 7 | void writechecksum(uint8_t *address) |
7 | { | 8 | { |
@@ -36,12 +37,13 @@ void to_hex(char_t *a, const char_t *p, int size) | |||
36 | *a++ = c - 10 + 'A'; | 37 | *a++ = c - 10 + 'A'; |
37 | } | 38 | } |
38 | } | 39 | } |
40 | a = '\0'; | ||
39 | } | 41 | } |
40 | 42 | ||
41 | /* From utox/util.c */ | 43 | /* From utox/util.c */ |
42 | void id_to_string(char_t *dest, const char_t *src) | 44 | void id_to_string(char_t *dest, const char_t *src) |
43 | { | 45 | { |
44 | to_hex(dest, src, TOX_FRIEND_ADDRESS_SIZE); | 46 | to_hex(dest, src, TOX_FRIEND_ADDRESS_SIZE - 1); |
45 | } | 47 | } |
46 | 48 | ||
47 | /* From utox/util.c */ | 49 | /* From utox/util.c */ |