diff --git a/toxcore/util.c b/toxcore/util.c index 46b33400..e3bfac4c 100644 --- a/toxcore/util.c +++ b/toxcore/util.c @@ -58,12 +58,12 @@ int is_timeout(uint64_t timestamp, uint64_t timeout) /* id functions */ -bool id_equal(uint8_t *dest, uint8_t *src) +bool id_equal(const uint8_t *dest, const uint8_t *src) { return memcmp(dest, src, CLIENT_ID_SIZE) == 0; } -uint32_t id_copy(uint8_t *dest, uint8_t *src) +uint32_t id_copy(uint8_t *dest, const uint8_t *src) { memcpy(dest, src, CLIENT_ID_SIZE); return CLIENT_ID_SIZE; diff --git a/toxcore/util.h b/toxcore/util.h index 71c2f5c7..74348c11 100644 --- a/toxcore/util.h +++ b/toxcore/util.h @@ -36,8 +36,8 @@ int is_timeout(uint64_t timestamp, uint64_t timeout); /* id functions */ -bool id_equal(uint8_t *dest, uint8_t *src); -uint32_t id_copy(uint8_t *dest, uint8_t *src); /* return value is CLIENT_ID_SIZE */ +bool id_equal(const uint8_t *dest, const uint8_t *src); +uint32_t id_copy(uint8_t *dest, const uint8_t *src); /* return value is CLIENT_ID_SIZE */ void host_to_net(uint8_t *num, uint16_t numbytes); #define net_to_host(x, y) host_to_net(x, y)