lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> For what is worth, I don't remember _ever_ having had trouble with the
> 0 index in string functions, or do I remember people posting about it
> on the list, so I've never seen these "tons of off-by-ones" in
> practice.

Please see http://lua-users.org/lists/lua-l/2013-02/threads.html#00212 and follow-ups.
Not tons of problems, but happened in practice.
Please note that this case still contradicts the reference manual:

"...and string.sub(s, -i) returns a suffix of s with length i."
Is not true for i == 0.

- Jörg