[Top][All Lists]
[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
- Re: thousands separator, (continued)
Re: thousands separator, Gary Ashburn, 2009/07/06
Re: thousands separator, Aharon Robbins, 2009/07/07
Re: thousands separator, Aharon Robbins, 2009/07/08
Re: thousands separator, Aharon Robbins, 2009/07/08
Re: thousands separator, KIMURA Koichi, 2009/07/09
Re: thousands separator,
Aharon Robbins <=
Re: thousands separator, Aharon Robbins, 2009/07/09