fix Bytearray from table constructor

This commit is contained in:
MihailRis
2025-06-28 21:33:49 +03:00
parent b3a5ea8e06
commit d9d65a169c
2 changed files with 4 additions and 1 deletions
+1 -1
View File
@@ -179,7 +179,7 @@ local FFIBytearray = {
return bytearray_type(buffer, #n, #n)
elseif t == "table" then
local capacity = math.max(#n, MIN_CAPACITY)
local buffer = malloc(capacity)
local buffer = FFI.cast("unsigned char*", malloc(capacity))
for i=1,#n do
buffer[i - 1] = n[i]
end