Rick Jones wrote:
> r.darlea@gmail.com wrote:
>> crt_locale = strdup(setlocale(LC_CTYPE, NULL));
>
> I cannot say I know anything about setlocale, but the HP-UX manpage
> says this:
>
> Setting the Locale of a Program
> To set the program's locale for category, setlocale() accepts
> one of the following values as the locale argument: locale name,
> C, POSIX, or "" (the empty string). The actions prescribed by
> these values are as follows:
>
> I don't see NULL in there.
Even though it is not explicit, it does mention the NULL usage.
! Querying the Locale of a Program
! setlocale() queries the current NLS environment pertaining to
! category, if the value of locale is NULL. The query operation
! does not change the environment.
!
!...
!
! To query a user's locale:
! char *ch = setlocale(LC_ALL, NULL);
--vishwas