bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: thousands separator


From: Aharon Robbins
Subject: Re: thousands separator
Date: Thu, 09 Jul 2009 21:38:42 +0300

Hi!  This would seem to clear up the issue. I'll make a patch along these
lines and see if that helps.

Thanks,

Arnold

> Date: Thu, 09 Jul 2009 16:06:50 +0900
> From: KIMURA Koichi <address@hidden>
> To: Aharon Robbins <address@hidden>, address@hidden
> Subject: Re: thousands separator
> Cc: address@hidden
>
> Hi,
>
> Arnold, struct lconv have some member which is pointer to something.  In 
> MSVC's libc (MinGW use the 
> MSCVRT.DLL too), thease pointer become a dangling pointer by any locale 
> fucntion such as setlocale().
>  And you have to copy the variable deeply if you need copy of lconv.
>
> So, 
>
>         loc = *localeconv();  /* Make a local copy of locale numeric info, 
> early on */
>
> should write like as following (in Windows box):
>
>         {
>                 struct lconv *t;
>                 t = localeconv();
>                 loc = *t;
>                 loc.thousands_sep = strdup(t->thousands_sep);
>                 loc.decimal_point = strdup(t->decimal_point);
>                 loc.grouping = strdup(t->grouping);
>                 loc.int_curr_symbol = strdup(t->int_curr_symbol);
>                 loc.currency_symbol = strdup(t->currency_symbol);
>                 loc.mon_decimal_point = strdup(t->mon_decimal_point);
>                 loc.mon_thousands_sep = strdup(t->mon_thousands_sep);
>                 loc.mon_grouping = strdup(t->mon_grouping);
>                 loc.positive_sign = strdup(t->positive_sign);
>                 loc.negative_sign = strdup(t->negative_sign);
>         }
>
> hope this help,
> -- 
> KIMURA Koichi




reply via email to

[Prev in Thread] Current Thread [Next in Thread]