diff options
author | iphydf <iphydf@users.noreply.github.com> | 2016-11-14 01:59:06 +0100 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2016-11-15 17:56:21 +0000 |
commit | 878efdc969facf85d43498d4025ca7841de8b3bc (patch) | |
tree | b9a7fe3b7a0db3a887899600e573b1c57a96cee6 /toxcore/tox.c | |
parent | 8822f595a8eaa3eb20195c967642445377aa3881 (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.c | 4 |
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) | |||
479 | void tox_self_set_nospam(Tox *tox, uint32_t nospam) | 479 | void 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 | ||
485 | uint32_t tox_self_get_nospam(const Tox *tox) | 485 | uint32_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 | ||
491 | void tox_self_get_public_key(const Tox *tox, uint8_t *public_key) | 491 | void tox_self_get_public_key(const Tox *tox, uint8_t *public_key) |