From f7f5170d00ee10affcacf569842207120a7ab16d Mon Sep 17 00:00:00 2001 From: GDR! Date: Thu, 11 Dec 2014 22:30:51 +0100 Subject: Fixed a warning and printing garbage --- util.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'util.c') diff --git a/util.c b/util.c index 653a009..8391279 100644 --- a/util.c +++ b/util.c @@ -2,6 +2,7 @@ #include #include #include +#include void writechecksum(uint8_t *address) { @@ -36,12 +37,13 @@ void to_hex(char_t *a, const char_t *p, int size) *a++ = c - 10 + 'A'; } } + a = '\0'; } /* From utox/util.c */ void id_to_string(char_t *dest, const char_t *src) { - to_hex(dest, src, TOX_FRIEND_ADDRESS_SIZE); + to_hex(dest, src, TOX_FRIEND_ADDRESS_SIZE - 1); } /* From utox/util.c */ -- cgit v1.2.3