lua-users home
lua-l archive

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


On Tue, 09 Sep 2008 11:52:25 +0100
David Welch <david.welch@thorcom.co.uk> wrote:

> Hi,
> 
> Just a heads up about a possible bug.  I have a lua script with:
>   os.date("%.d", 123)
> 
> which crashes when run.  The lua version is Lua 5.1.4 which I
> downloaded from lua binaries.

This doesn't cause anything other than the expected to happen (ie,
it returns "%.d") using 5.1.2 or 5.1.4 under Ubuntu Linux, so I suspect
it may be your OS's C library treating such strings differently than
glibc.

If this is a widespread issue (which OS are you on) then it may be
worth investigating adding a layer of checking of the format string to
Lua's wrapper for it.

B.