diff --git a/src/wipflog.c b/src/wipflog.c index f96d33f4..1ebe373e 100644 --- a/src/wipflog.c +++ b/src/wipflog.c @@ -2,9 +2,11 @@ #define WIPF_BUFFER_SIZE 16 * 1024 #define WIPF_LOG_PATH_MAX 512 +#define WIPF_LOG_ALIGN 4 #define WIPF_LOG_SIZE(path_len) \ - (sizeof(UINT32) + sizeof(UINT32) + sizeof(UINT32) + (path_len)) + ((sizeof(UINT32) + sizeof(UINT32) + sizeof(UINT32) + (path_len)) \ + + (WIPF_LOG_ALIGN-1)) & ~(WIPF_LOG_ALIGN-1) static void diff --git a/test/wipf_test.lua b/test/wipf_test.lua index ac6de6cb..40d3a99d 100644 --- a/test/wipf_test.lua +++ b/test/wipf_test.lua @@ -9,7 +9,7 @@ local mem, win32 = sys.mem, sys.win32 print"-- Log Write" do local path = "/test" - local outlen = 12 + #path + local outlen = 12 + #path + 3 local bufsize = outlen + 4 local buf = assert(mem.pointer(bufsize))