By using setlocale(LC_ALL, ""); in PS_boot() and ps_printf() the pslib is changing locale of the program using the library.
In may have a very bad result:
- parent program is run in environment with decimal separator set to "comma"
- parent program switches to C locale (or remain in it as it's the default one) to ensure a "dot" as decimal separator
- parent program does some calls to pslib which switches to the "comma"-locale by doing setlocale(LC_ALL, "");
- parent program has the locale changed
A solution would be to first check the previous locale (setlocale(NULL,"")) and revert to the previous one before returning the control to the parent program.
This problem was reported for GNU Data Language: