summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/loadlib_rel.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/loadlib_rel.c b/src/loadlib_rel.c
index 3182e68..4c8186d 100644
--- a/src/loadlib_rel.c
+++ b/src/loadlib_rel.c
@@ -164,7 +164,7 @@ static void setprogdir(lua_State *L) {
mib[1] = KERN_PROC;
mib[2] = KERN_PROC_PATHNAME;
mib[3] = -1;
- size_t cb = sizeof(progdir);
+ size_t cb = nsize;
sysctl(mib, 4, progdir, &cb, NULL, 0);
n = cb;
#elif defined(__BSD__)