lua-users home
lua-l archive

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


Roberto Ierusalimschy wrote:
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.

Lua 5.2 has this layer. According to ISO C, "If a conversion specifier
is not one of the above,the behavior is undefined", and undefined
behavior includes crashing. It is a really stupid behavior, but it is
"legally correct" :( It is also a pity, because os.date will no longer
accept OS-specific extensions.

-- Roberto
Settings the invalid parameter handling (_set_invalid_parameter_handler) seems to make it not crash.

--
David Welch

Thorcom Systems Limited, Unit 4, 96B Blackpole Trading Estate West, Worcester, WR3 8TJ
Tel: +44 (0)1905 756700  Fax: +44 (0)1905 755777  Web: www.thorcom.co.uk
Registered in England and Wales number 2704696.