From a8f89c868d992d9772d9a94bbacf1d55225dd187 Mon Sep 17 00:00:00 2001 From: z3bra Date: Wed, 9 Nov 2016 10:36:50 +0100 Subject: Fix nospam value endianness --- ratox.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ratox.c b/ratox.c index 24a8fe3..471e9b4 100644 --- a/ratox.c +++ b/ratox.c @@ -3,6 +3,8 @@ #include #include +#include + #include #include #include @@ -212,7 +214,7 @@ static void friendload(void); static void frienddestroy(struct friend *); static void loop(void); static void initshutdown(int); -static void shutdown(void); +static void toxshutdown(void); static void usage(void); #define FD_APPEND(fd) do { \ @@ -1503,7 +1505,7 @@ setnospam(void *data) } } - nsval = strtoul((char *)nospam, NULL, 16); + nsval = htonl(strtoul((char *)nospam, NULL, 16)); tox_self_set_nospam(tox, nsval); datasave(); logmsg("Nospam > %08X\n", nsval); @@ -1773,7 +1775,7 @@ initshutdown(int sig) } static void -shutdown(void) +toxshutdown(void) { struct friend *f, *ftmp; struct request *r, *rtmp; @@ -1880,6 +1882,6 @@ main(int argc, char *argv[]) localinit(); friendload(); loop(); - shutdown(); + toxshutdown(); return 0; } -- cgit v1.2.3