diff options
author | ache <ache@FreeBSD.org> | 2001-02-10 01:38:18 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2001-02-10 01:38:18 +0000 |
commit | 0ec6d3ee51e24e43ec6ad9463cbebee9edf3aa08 (patch) | |
tree | f9a7dda1c7bab98116393fa4c83958293ba8ffff /lib/libc/locale | |
parent | 55d37192a42331f1909034340592bfe742b45594 (diff) | |
download | FreeBSD-src-0ec6d3ee51e24e43ec6ad9463cbebee9edf3aa08.zip FreeBSD-src-0ec6d3ee51e24e43ec6ad9463cbebee9edf3aa08.tar.gz |
Correct myself a bit: situation is broken not for _all_ numeric LC_MONETARY,
LC_NUMERIC fields, but only for *grouping fields - other fields are converted
to a chars in localeconv(), so final change is:
"-1" -> "127"
127 here is because CHAR_MAX supposed, which is _positive_ (SUSv2 requirement),
not negative as 255. It is still a bit of hack. To find real CHAR_MAX will be
better to sprintf() it once somewhere in static buffer. *grouping parsing
still broken and missing and needs to be implemented.
Diffstat (limited to 'lib/libc/locale')
-rw-r--r-- | lib/libc/locale/lmonetary.c | 3 | ||||
-rw-r--r-- | lib/libc/locale/lnumeric.c | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/lib/libc/locale/lmonetary.c b/lib/libc/locale/lmonetary.c index 22c157f..45af48a 100644 --- a/lib/libc/locale/lmonetary.c +++ b/lib/libc/locale/lmonetary.c @@ -26,7 +26,6 @@ * $FreeBSD$ */ -#include <limits.h> #include "lmonetary.h" #include "ldpart.h" @@ -35,7 +34,7 @@ extern int __mlocale_changed; #define LCMONETARY_SIZE (sizeof(struct lc_monetary_T) / sizeof(char *)) static char empty[] = ""; -static char numempty[] = { CHAR_MAX, '\0' }; +static char numempty[] = "127"; /* XXX: CHAR_MAX supposed here */ static const struct lc_monetary_T _C_monetary_locale = { empty , /* int_curr_symbol */ diff --git a/lib/libc/locale/lnumeric.c b/lib/libc/locale/lnumeric.c index bbf118c..cfe3f5b 100644 --- a/lib/libc/locale/lnumeric.c +++ b/lib/libc/locale/lnumeric.c @@ -26,7 +26,6 @@ * $FreeBSD$ */ -#include <limits.h> #include "lnumeric.h" #include "ldpart.h" @@ -34,7 +33,7 @@ extern int __nlocale_changed; #define LCNUMERIC_SIZE (sizeof(struct lc_numeric_T) / sizeof(char *)) -static char numempty[] = { CHAR_MAX, '\0' }; +static char numempty[] = "127"; /* XXX: CHAR_MAX supposed here */ static const struct lc_numeric_T _C_numeric_locale = { ".", /* decimal_point */ |