[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Badly formatted os.date format crashes
- From: David Welch <david.welch@...>
- Date: Tue, 09 Sep 2008 13:28:27 +0100
Roberto Ierusalimschy wrote:
Settings the invalid parameter handling (_set_invalid_parameter_handler)
seems to make it not crash.
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.
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.