diff options
| author | Danilo M. <danix@danix.xyz> | 2026-10-18 14:31:05 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-10-18 14:31:05 +0200 |
| commit | 719e1d98d61aa0614db86a9cab79402b304c4852 (patch) | |
| tree | b1f77a6c6be6a432cf9da93fcd1c57cd1fa005d0 /lib/weather.lua | |
| parent | 57d52f2133edb97031fa578528cfce6717108654 (diff) | |
| download | conky-theme-udt-719e1d98d61aa0614db86a9cab79402b304c4852.tar.gz conky-theme-udt-719e1d98d61aa0614db86a9cab79402b304c4852.zip | |
fix(weather): moon_icon survives integer overflow
phase * 28 wrapped for math.maxinteger; multiply as a float so the
result goes through the non-finite check.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Diffstat (limited to 'lib/weather.lua')
| -rw-r--r-- | lib/weather.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/weather.lua b/lib/weather.lua index d4b1460..56cf92b 100644 --- a/lib/weather.lua +++ b/lib/weather.lua @@ -142,7 +142,7 @@ end -- One of the 28 Nerd Font moon glyphs, U+E38D (new) to U+E3A8, in phase order. function M.moon_icon(phase) if type(phase) ~= 'number' then return M.ICON.unknown end - local r = round(phase * 28) + local r = round(phase * 28.0) if not r then return M.ICON.unknown end return utf8.char(0xE38D + r % 28) end |
