diff options
author | 2015-01-20 21:10:44 +0100 | |
---|---|---|
committer | 2015-01-20 21:10:44 +0100 | |
commit | 21322a016e74ddf20cffaab5d621db1cf694eaa5 (patch) | |
tree | 9b837c6088bd758950524aa489af54c690bf6572 /player/lua.c | |
parent | 9f63b9f6733869ddcd1118545d32cde850885056 (diff) |
client API: check locale, and reject anything other than "C" locale
Sigh...
The C locale system is incredibly shitty, and if used, breaks basic
string functions. The locale can change the decimal mark from "." to
",", which affects conversion between floats and strings: snprintf() and
strtod() respect the locale decimal mark, and change behavior. (What's
even better, the behavior of these functions can change asynchronously,
if setlocale() is called after threads were started.)
So just check the locale in the client API, and refuse to work if it's
wrong. This also makes the lib print to stderr, which I consider the
lesser evil in this specific situation.
Diffstat (limited to 'player/lua.c')
0 files changed, 0 insertions, 0 deletions