diff -r 279f343bbf6c -r fac51f87def0 src/server/util/util.c --- a/src/server/util/util.c Wed Jul 31 13:02:06 2013 +0200 +++ b/src/server/util/util.c Sun Sep 08 23:27:07 2013 +0200 @@ -53,6 +53,8 @@ #include "../daemon/netsite.h" #include "../public/nsapi.h" +#include +#include #include "util.h" @@ -484,9 +486,9 @@ return newstr; } if(s.length == 1) { - newstr = sstrncat(3, newstr, parent, s, child); + newstr = sstrncat(newstr, 3, parent, s, child); } else { - newstr = sstrncat(2, newstr, parent, child); + newstr = sstrncat(newstr, 2, parent, child); } newstr.ptr[newstr.length] = '\0'; @@ -568,3 +570,17 @@ return pb; } + +// TODO: remove +sstr_t sstrdup_mp(UcxMempool *pool, sstr_t s) { + sstr_t newstring; + newstring.ptr = (char*)ucx_mempool_malloc(pool, s.length + 1); + if (newstring.ptr != NULL) { + newstring.length = s.length; + newstring.ptr[newstring.length] = 0; + + memcpy(newstring.ptr, s.ptr, s.length); + } + + return newstring; +}