summaryrefslogtreecommitdiff
path: root/ratox.c
diff options
context:
space:
mode:
authorz3bra <contactatz3bradotorg>2016-11-09 10:36:50 +0100
committerz3bra <contactatz3bradotorg>2016-11-09 12:51:53 +0100
commita8f89c868d992d9772d9a94bbacf1d55225dd187 (patch)
treeea01f593b3de19c1eb8d2360fa41a39fb5b6aac5 /ratox.c
parent3be4e82638e4a917f7acf2b15bcf04a34fd6626c (diff)
Fix nospam value endianness
Diffstat (limited to 'ratox.c')
-rw-r--r--ratox.c10
1 files 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 <sys/stat.h>
#include <sys/types.h>
+#include <arpa/inet.h>
+
#include <ctype.h>
#include <dirent.h>
#include <errno.h>
@@ -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;
}