summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2015-09-24 06:40:05 +0000
committerRich Felker <dalias@aerifal.cx>2015-09-24 06:40:05 +0000
commitb4d94ba40dda0fa0c3f499beed51b55ad31d5305 (patch)
tree8bd872b947e9966d88abac7c2a2ea5ed1284ff3f
parentbd275378d35b3535bc8b8321780b00e486c36d96 (diff)
downloadmusl-b4d94ba40dda0fa0c3f499beed51b55ad31d5305.tar.gz
musl-b4d94ba40dda0fa0c3f499beed51b55ad31d5305.tar.bz2
musl-b4d94ba40dda0fa0c3f499beed51b55ad31d5305.tar.xz
musl-b4d94ba40dda0fa0c3f499beed51b55ad31d5305.zip
fix localeconv field value for unavailable values
per ISO C, CHAR_MAX, not -1, is the value used to indicate that a char field in struct lconv is unavailable. patch by Julien Ramseier.
-rw-r--r--src/locale/localeconv.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/locale/localeconv.c b/src/locale/localeconv.c
index cbc75d7a..4cbb9dc5 100644
--- a/src/locale/localeconv.c
+++ b/src/locale/localeconv.c
@@ -1,4 +1,5 @@
#include <locale.h>
+#include <limits.h>
static const struct lconv posix_lconv = {
.decimal_point = ".",
@@ -11,20 +12,20 @@ static const struct lconv posix_lconv = {
.mon_grouping = "",
.positive_sign = "",
.negative_sign = "",
- .int_frac_digits = -1,
- .frac_digits = -1,
- .p_cs_precedes = -1,
- .p_sep_by_space = -1,
- .n_cs_precedes = -1,
- .n_sep_by_space = -1,
- .p_sign_posn = -1,
- .n_sign_posn = -1,
- .int_p_cs_precedes = -1,
- .int_p_sep_by_space = -1,
- .int_n_cs_precedes = -1,
- .int_n_sep_by_space = -1,
- .int_p_sign_posn = -1,
- .int_n_sign_posn = -1,
+ .int_frac_digits = CHAR_MAX,
+ .frac_digits = CHAR_MAX,
+ .p_cs_precedes = CHAR_MAX,
+ .p_sep_by_space = CHAR_MAX,
+ .n_cs_precedes = CHAR_MAX,
+ .n_sep_by_space = CHAR_MAX,
+ .p_sign_posn = CHAR_MAX,
+ .n_sign_posn = CHAR_MAX,
+ .int_p_cs_precedes = CHAR_MAX,
+ .int_p_sep_by_space = CHAR_MAX,
+ .int_n_cs_precedes = CHAR_MAX,
+ .int_n_sep_by_space = CHAR_MAX,
+ .int_p_sign_posn = CHAR_MAX,
+ .int_n_sign_posn = CHAR_MAX,
};
struct lconv *localeconv(void)