summaryrefslogtreecommitdiffstats
path: root/lib/libc/locale/localeconv.c
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2002-01-28 08:26:38 +0000
committerache <ache@FreeBSD.org>2002-01-28 08:26:38 +0000
commita68692c6f24ace8efe344f02d4192cca660b589d (patch)
treea2c8c68924388ebcaa76414c890444b5fb2e6d4a /lib/libc/locale/localeconv.c
parent119a6ca6f133a8f85e3390d1c6540c5a8edf0983 (diff)
downloadFreeBSD-src-a68692c6f24ace8efe344f02d4192cca660b589d.zip
FreeBSD-src-a68692c6f24ace8efe344f02d4192cca660b589d.tar.gz
Do not try to convert to char already converted C monetary locale members.
Do this conversion on locale load stage instead.
Diffstat (limited to 'lib/libc/locale/localeconv.c')
-rw-r--r--lib/libc/locale/localeconv.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/lib/libc/locale/localeconv.c b/lib/libc/locale/localeconv.c
index 35ddc79..d4c823d 100644
--- a/lib/libc/locale/localeconv.c
+++ b/lib/libc/locale/localeconv.c
@@ -41,8 +41,6 @@ static char rcsid[] =
#endif /* LIBC_SCCS and not lint */
#include <locale.h>
-#include <stdlib.h>
-#include <limits.h>
#include "lmonetary.h"
#include "lnumeric.h"
@@ -58,14 +56,6 @@ static char rcsid[] =
int __mlocale_changed = 1;
int __nlocale_changed = 1;
-static char
-cnv(char *str) {
- int i = strtol(str, NULL, 10);
- if (i == -1)
- i = CHAR_MAX;
- return (char)i;
-}
-
/*
* Return the current locale conversion.
*/
@@ -79,7 +69,7 @@ localeconv()
struct lc_monetary_T * mptr;
#define M_ASSIGN_STR(NAME) (ret.NAME = (char*)mptr->NAME)
-#define M_ASSIGN_CHAR(NAME) (ret.NAME = cnv((char*)mptr->NAME))
+#define M_ASSIGN_CHAR(NAME) (ret.NAME = mptr->NAME[0])
mptr = __get_current_monetary_locale();
M_ASSIGN_STR(int_curr_symbol);
OpenPOWER on IntegriCloud