tFix nospam value endianness - ratox - FIFO based tox client
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit a8f89c868d992d9772d9a94bbacf1d55225dd187
 (DIR) parent 3be4e82638e4a917f7acf2b15bcf04a34fd6626c
 (HTM) Author: z3bra <contactatz3bradotorg>
       Date:   Wed,  9 Nov 2016 10:36:50 +0100
       
       Fix nospam value endianness
       
       Diffstat:
         M ratox.c                             |      10 ++++++----
       
       1 file changed, 6 insertions(+), 4 deletions(-)
       ---
 (DIR) diff --git a/ratox.c b/ratox.c
       t@@ -3,6 +3,8 @@
        #include <sys/stat.h>
        #include <sys/types.h>
        
       +#include <arpa/inet.h>
       +
        #include <ctype.h>
        #include <dirent.h>
        #include <errno.h>
       t@@ -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 {        \
       t@@ -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);
       t@@ -1773,7 +1775,7 @@ initshutdown(int sig)
        }
        
        static void
       -shutdown(void)
       +toxshutdown(void)
        {
                struct friend *f, *ftmp;
                struct request *r, *rtmp;
       t@@ -1880,6 +1882,6 @@ main(int argc, char *argv[])
                localinit();
                friendload();
                loop();
       -        shutdown();
       +        toxshutdown();
                return 0;
        }