Forum OpenACS Development: ns_localtime_r

Collapse
Posted by Maurizio Martignano on
Hello all, I know this is not the right place to rise this type of issues and I do apologise in advance.

Anyhow, inside the newly added function ns_localtime_r (in reentrant.c) I believe that the following line:

errNum = localtime_s(&tlsPtr->ltbuf, timer);

should actually be:

errno_t errNum;
errNum = localtime_s(timer, buf);

Thank you very much,
Maurizio

Collapse
2: Re: ns_localtime_r (response to 1)
Posted by Gustaf Neumann on
Maurizio, your are right, the variable declaration on the windows only section was missing. This function was not yet tested on windows.... one of the dangers of working with unlreased code -g
Collapse
3: Re: ns_localtime_r (response to 2)
Posted by Maurizio Martignano on
Thank you very much Gustaf!

It's not only the variable declaration that was missing, also the function parameters should change:

from

localtime_s(&tlsPtr->ltbuf, timer);

to

localtime_s(timer, buf);

Again thank you,
Maurizio

Collapse
4: Re: ns_localtime_r (response to 3)
Posted by Gustaf Neumann on
the arguments have to be flipped. I've compiled the code and made several more changes to improve windows compatibility (e.g. range operations were broken under windows - probably since many years)
Collapse
5: Re: ns_localtime_r (response to 4)
Posted by Maurizio Martignano on
Dear Gustaf,
thank you very much for all your work!!!
Maurizio