From 340488b7f3615a48f7464f596754514653112fd6 Mon Sep 17 00:00:00 2001 From: pranomostro Date: Fri, 2 Dec 2016 11:09:23 +0100 Subject: Fix issue with endianness in confcreate(). --- ratox.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ratox.c b/ratox.c index 266524e..36a98cf 100644 --- a/ratox.c +++ b/ratox.c @@ -3,6 +3,8 @@ #include #include +#include + #include #include #include @@ -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); -- cgit v1.2.3