summaryrefslogtreecommitdiff
path: root/ratox.c
diff options
context:
space:
mode:
authorpranomostro <pranomestro@gmail.com>2016-12-02 11:09:23 +0100
committerpranomostro <pranomestro@gmail.com>2016-12-02 11:09:23 +0100
commit340488b7f3615a48f7464f596754514653112fd6 (patch)
tree4258ac87e7aded9303f21a53baa7679472ccfa17 /ratox.c
parentf008567f6d674c99b618fa87509152f73783bc44 (diff)
Fix issue with endianness in confcreate().
Diffstat (limited to 'ratox.c')
-rw-r--r--ratox.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ratox.c b/ratox.c
index 266524e..36a98cf 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>
@@ -1362,7 +1364,7 @@ confcreate(uint32_t cnum)
if(!c)
eprintf("calloc:");
c->num = cnum;
- sprintf(c->numstr, "%08X", c->num);
+ sprintf(c->numstr, "%08X", ntohl(c->num));
r = mkdir(c->numstr, 0777);
if(r < 0 && errno != EEXIST)
eprintf("mkdir %s:", c->numstr);