diff options
Diffstat (limited to 'wcsmbs/mbsrtowcs.c')
-rw-r--r-- | wcsmbs/mbsrtowcs.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/wcsmbs/mbsrtowcs.c b/wcsmbs/mbsrtowcs.c index 097e462..602dd5e 100644 --- a/wcsmbs/mbsrtowcs.c +++ b/wcsmbs/mbsrtowcs.c @@ -58,6 +58,7 @@ __mbsrtowcs (dst, src, len, ps) int status; struct __gconv_step *towc; size_t non_reversible; + const struct gconv_fcts *fcts; /* Tell where we want the result. */ data.__invocation_counter = 0; @@ -70,16 +71,15 @@ __mbsrtowcs (dst, src, len, ps) #endif data.__trans = NULL; + /* Get the conversion functions. */ #ifdef USE_IN_EXTENDED_LOCALE_MODEL - /* Get the conversion function matching the locale. */ - towc = wcsmbs_get_towc_func (l); + fcts = get_gconv_fcts (l->__locales[LC_CTYPE]); #else - /* Make sure we use the correct function. */ - update_conversion_ptrs (); + fcts = get_gconv_fcts (_NL_CURRENT_DATA (LC_CTYPE)); +#endif /* Get the structure with the function pointers. */ - towc = __wcsmbs_gconv_fcts.towc; -#endif + towc = fcts->towc; /* We have to handle DST == NULL special. */ if (dst == NULL) @@ -160,11 +160,6 @@ __mbsrtowcs (dst, src, len, ps) __set_errno (EILSEQ); } -#ifdef USE_IN_EXTENDED_LOCALE_MODEL - /* Free the conversion function data structures. */ - wcsmbs_free_funcs (towc); -#endif - return result; } #ifndef USE_IN_EXTENDED_LOCALE_MODEL |