cc strings infinite loop mitigation

This commit is contained in:
Mikayla Fischler 2024-07-22 23:44:34 -04:00
parent fd06730e46
commit 1358d95269

View File

@ -24,7 +24,7 @@ local t_pack = table.pack
local util = {} local util = {}
-- scada-common version -- scada-common version
util.version = "1.4.0" util.version = "1.4.1"
util.TICK_TIME_S = 0.05 util.TICK_TIME_S = 0.05
util.TICK_TIME_MS = 50 util.TICK_TIME_MS = 50
@ -113,9 +113,12 @@ end
-- wrap a string into a table of lines -- wrap a string into a table of lines
---@nodiscard ---@nodiscard
---@param str string ---@param str string
---@param limit integer line limit ---@param limit integer line limit, must be greater than 0
---@return table lines ---@return table lines
function util.strwrap(str, limit) return cc_strings.wrap(str, limit) end function util.strwrap(str, limit)
assert(limit > 0, "util.strwrap() limit not greater than 0")
return cc_strings.wrap(str, limit)
end
-- concatenation with built-in to string -- concatenation with built-in to string
---@nodiscard ---@nodiscard