summaryrefslogtreecommitdiffstats
path: root/lib/libc/locale/lmonetary.c
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2001-02-10 00:43:32 +0000
committerache <ache@FreeBSD.org>2001-02-10 00:43:32 +0000
commit55d37192a42331f1909034340592bfe742b45594 (patch)
tree8d5ebfae4818c26a7323bf291c06aeb50a489f07 /lib/libc/locale/lmonetary.c
parentbc66105b1dd64dd9599a78cd769be24fc39b89ea (diff)
downloadFreeBSD-src-55d37192a42331f1909034340592bfe742b45594.zip
FreeBSD-src-55d37192a42331f1909034340592bfe742b45594.tar.gz
NOTE: according to SUSV2 and other implementations, numeric elements in
LC_MONETARY, LC_NUMERIC are byte-arrays, not ASCII strings! Fix "C" locale, change "-1" to {CHAR_MAX, '\0'} according to standards. This is only partial fix - locale loading procedure remains broken as before and load too big values for all locales. All numeric strings there should be converted with something like atoi() and placed into bytes. Maybe I do it later, if someone will not fix it faster.
Diffstat (limited to 'lib/libc/locale/lmonetary.c')
-rw-r--r--lib/libc/locale/lmonetary.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libc/locale/lmonetary.c b/lib/libc/locale/lmonetary.c
index 0b8581a..22c157f 100644
--- a/lib/libc/locale/lmonetary.c
+++ b/lib/libc/locale/lmonetary.c
@@ -26,6 +26,7 @@
* $FreeBSD$
*/
+#include <limits.h>
#include "lmonetary.h"
#include "ldpart.h"
@@ -34,7 +35,7 @@ extern int __mlocale_changed;
#define LCMONETARY_SIZE (sizeof(struct lc_monetary_T) / sizeof(char *))
static char empty[] = "";
-static char numempty[] = "-1";
+static char numempty[] = { CHAR_MAX, '\0' };
static const struct lc_monetary_T _C_monetary_locale = {
empty , /* int_curr_symbol */
OpenPOWER on IntegriCloud