mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 10:31:50 +00:00
fixes
This commit is contained in:
parent
f539ddf9e0
commit
19237b60dc
2 changed files with 5 additions and 5 deletions
|
|
@ -54,7 +54,7 @@ function lib.write(descriptor, data)
|
|||
local end_pos = pos + data_length - 1
|
||||
|
||||
-- size ensuring
|
||||
if endPos > buf_length then
|
||||
if end_pos > buf_length then
|
||||
for i = buf_length + 1, end_pos do
|
||||
buf[i] = 0
|
||||
end
|
||||
|
|
|
|||
|
|
@ -166,19 +166,19 @@ function io_stream:__read(length, from_read_fully)
|
|||
elseif self.mode == BUFFERED_MODE then
|
||||
local buf_len = #self.read_buffer
|
||||
|
||||
if bufLen < length then
|
||||
if buf_len < length then
|
||||
self.read_buffer:append(
|
||||
self.io_lib.read(self.descriptor, self.max_buffer_size - buf_len)
|
||||
)
|
||||
end
|
||||
|
||||
bufLen = #self.read_buffer
|
||||
buf_len = #self.read_buffer
|
||||
|
||||
length = math.min(buf_len, length)
|
||||
|
||||
local copy = self.read_buffer:slice(1, length)
|
||||
|
||||
if bufLen == length then
|
||||
if buf_len == length then
|
||||
self.read_buffer:clear()
|
||||
else
|
||||
self.read_buffer:remove(1, length)
|
||||
|
|
@ -387,7 +387,7 @@ function io_stream:write(arg, ...)
|
|||
else
|
||||
if arg_type == "string" then
|
||||
self:write_line(arg)
|
||||
elseif argType == "table" then
|
||||
elseif arg_type == "table" then
|
||||
for i = 1, #arg do
|
||||
self:write_line(arg[i])
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue