Skip to content

Commit d75d764

Browse files
authored
Update util.lua
1 parent 1da166f commit d75d764

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/prometheus/util.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ local function bytesToString(arr)
237237
str = str .. string.char(table.unpack(arr, (i - 1) * MAX_UNPACK_COUNT + 1, i * MAX_UNPACK_COUNT));
238238
end
239239

240-
return str..string.char(table.unpack(arr, lenght - overflow + 1, lenght));
240+
return str..(overflow > 0 and string.char(table.unpack(arr, lenght - overflow + 1, lenght)) or "");
241241
end
242242

243243
local function isNaN(n)

0 commit comments

Comments
 (0)