# HG changeset patch # User Kim Alvefur # Date 1436445527 -7200 # Node ID ce671935f50449c3a57e3030c44af9a82e9ed19c # Parent f3a458479f9c122e0f30419d96811865031e9bc1 plugins.xkcd2: Use table.maxn as there may be holes in the list diff -r f3a458479f9c -r ce671935f504 plugins/xkcd2.lua --- a/plugins/xkcd2.lua Thu Jul 09 14:38:17 2015 +0200 +++ b/plugins/xkcd2.lua Thu Jul 09 14:38:47 2015 +0200 @@ -21,7 +21,7 @@ if t ~= '"' then num = tonumber(num); if num and num < 0 then - num = #strip + num; + num = table.maxn(strips) + num; end end strip = strips[num or q:lower()];