summaryrefslogtreecommitdiff
path: root/toxcore/tox.c
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2016-11-14 01:59:06 +0100
committeriphydf <iphydf@users.noreply.github.com>2016-11-15 17:56:21 +0000
commit878efdc969facf85d43498d4025ca7841de8b3bc (patch)
treeb9a7fe3b7a0db3a887899600e573b1c57a96cee6 /toxcore/tox.c
parent8822f595a8eaa3eb20195c967642445377aa3881 (diff)
Convert to and from network byte order in set/get nospam.
Fixes #205.
Diffstat (limited to 'toxcore/tox.c')
-rw-r--r--toxcore/tox.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/toxcore/tox.c b/toxcore/tox.c
index 7898868b..c7d90871 100644
--- a/toxcore/tox.c
+++ b/toxcore/tox.c
@@ -479,13 +479,13 @@ void tox_self_get_address(const Tox *tox, uint8_t *address)
479void tox_self_set_nospam(Tox *tox, uint32_t nospam) 479void tox_self_set_nospam(Tox *tox, uint32_t nospam)
480{ 480{
481 Messenger *m = tox; 481 Messenger *m = tox;
482 set_nospam(&(m->fr), nospam); 482 set_nospam(&(m->fr), htonl(nospam));
483} 483}
484 484
485uint32_t tox_self_get_nospam(const Tox *tox) 485uint32_t tox_self_get_nospam(const Tox *tox)
486{ 486{
487 const Messenger *m = tox; 487 const Messenger *m = tox;
488 return get_nospam(&(m->fr)); 488 return ntohl(get_nospam(&(m->fr)));
489} 489}
490 490
491void tox_self_get_public_key(const Tox *tox, uint8_t *public_key) 491void tox_self_get_public_key(const Tox *tox, uint8_t *public_key)