diff options
Diffstat (limited to 'locale')
-rw-r--r-- | locale/programs/ld-collate.c | 2 | ||||
-rw-r--r-- | locale/programs/ld-ctype.c | 1 | ||||
-rw-r--r-- | locale/programs/ld-time.c | 17 | ||||
-rw-r--r-- | locale/programs/locale.c | 7 | ||||
-rw-r--r-- | locale/programs/localedef.c | 7 |
5 files changed, 23 insertions, 11 deletions
diff --git a/locale/programs/ld-collate.c b/locale/programs/ld-collate.c index a948b55ed3..1bfa533d98 100644 --- a/locale/programs/ld-collate.c +++ b/locale/programs/ld-collate.c @@ -1341,7 +1341,7 @@ collation element `%.*s' appears more than once: ignore line"), { unsigned int order = ++collate->order_cnt; - if ((unsigned int) tmp != 0) + if ((unsigned long int) tmp != 0ul) { lr_error (lr, _("\ collation symbol `.*s' appears more than once: ignore line"), diff --git a/locale/programs/ld-ctype.c b/locale/programs/ld-ctype.c index 196f990745..64f73d430f 100644 --- a/locale/programs/ld-ctype.c +++ b/locale/programs/ld-ctype.c @@ -21,6 +21,7 @@ Boston, MA 02111-1307, USA. */ # include <config.h> #endif +#include <alloca.h> #include <endian.h> #include <limits.h> #include <string.h> diff --git a/locale/programs/ld-time.c b/locale/programs/ld-time.c index 6f961b658a..6fcb06979a 100644 --- a/locale/programs/ld-time.c +++ b/locale/programs/ld-time.c @@ -395,7 +395,8 @@ time_output (struct localedef_t *locale, const char *output_path) struct iovec iov[2 + _NL_ITEM_INDEX (_NL_NUM_LC_TIME) + time->cur_num_era - 1 + time->cur_num_alt_digits - 1 - + 1 + (time->cur_num_era * 9 - 1) * 2]; + + 1 + (time->cur_num_era * 9 - 1) * 2 + + (time->cur_num_era == 0)]; struct locale_file data; u_int32_t idx[_NL_ITEM_INDEX (_NL_NUM_LC_TIME)]; size_t cnt, last_idx, num; @@ -635,11 +636,23 @@ time_output (struct localedef_t *locale, const char *output_path) /* idx[1 + last_idx] += 8 * sizeof (int32_t) + l; */ } + /* We have a problem when no era data is present. In this case the + data pointer for _NL_TIME_ERA_ENTRIES_EB and + _NL_TIME_ERA_ENTRIES_EL point after the end of the file. So we + introduce some dummy data here. */ + if (time->cur_num_era == 0) + { + static u_int32_t dummy = 0; + iov[2 + cnt].iov_base = (void *) &dummy; + iov[2 + cnt].iov_len = 4; + ++cnt; + } assert (cnt == (_NL_ITEM_INDEX (_NL_NUM_LC_TIME) + time->cur_num_era - 1 + time->cur_num_alt_digits - 1 - + 1 + (time->cur_num_era * 9 - 1) * 2) + + 1 + (time->cur_num_era * 9 - 1) * 2 + + (time->cur_num_era == 0)) && last_idx + 1 == _NL_ITEM_INDEX (_NL_NUM_LC_TIME)); write_locale_data (output_path, "LC_TIME", 2 + cnt, iov); diff --git a/locale/programs/locale.c b/locale/programs/locale.c index 667afbd188..fa824fb96c 100644 --- a/locale/programs/locale.c +++ b/locale/programs/locale.c @@ -183,14 +183,13 @@ main (int argc, char *argv[]) /* Version information is requested. */ if (do_version) { - fprintf (stderr, "locale (GNU %s) %s\n", PACKAGE, VERSION); - fprintf (stderr, _("\ + printf ("locale (GNU %s) %s\n", PACKAGE, VERSION); + printf (_("\ Copyright (C) %s Free Software Foundation, Inc.\n\ This is free software; see the source for copying conditions. There is NO\n\ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ "), "1995, 1996"); - fprintf (stderr, _("Written by %s.\n"), - "Ulrich Drepper"); + printf (_("Written by %s.\n"), "Ulrich Drepper"); exit (EXIT_SUCCESS); } diff --git a/locale/programs/localedef.c b/locale/programs/localedef.c index ff9248e317..6d37a0e398 100644 --- a/locale/programs/localedef.c +++ b/locale/programs/localedef.c @@ -173,14 +173,13 @@ main (int argc, char *argv[]) /* Version information is requested. */ if (do_version) { - fprintf (stderr, "localedef (GNU %s) %s\n", PACKAGE, VERSION); - fprintf (stderr, _("\ + printf ("localedef (GNU %s) %s\n", PACKAGE, VERSION); + printf (_("\ Copyright (C) %s Free Software Foundation, Inc.\n\ This is free software; see the source for copying conditions. There is NO\n\ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ "), "1995, 1996"); - fprintf (stderr, _("Written by %s.\n"), - "Ulrich Drepper"); + printf (_("Written by %s.\n"), "Ulrich Drepper"); exit (0); } |