mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
cc strings infinite loop mitigation
This commit is contained in:
parent
fd06730e46
commit
1358d95269
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user