-/* Copyright (C) 1996 Free Software Foundation, Inc.
+/* Functions to read locale data files.
+Copyright (C) 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1996.
/* LOCALE/LC_foo is a directory; open LOCALE/LC_foo/SYS_LC_foo
instead. */
char *newp;
-
+
__close (fd);
newp = (char *) alloca (strlen (file->filename)
if (W (filedata->nstrings) < _nl_category_num_items[category] ||
(sizeof *filedata + W (filedata->nstrings) * sizeof (unsigned int)
- >= st.st_size))
+ >= (size_t) st.st_size))
{
/* Insufficient data. */
errno = EINVAL;
}
newdata = malloc (sizeof *newdata +
- W (filedata->nstrings) * sizeof (union locale_data_value));
+ (_nl_category_num_items[category]
+ * sizeof (union locale_data_value)));
if (! newdata)
goto puntmap;
newdata->name = NULL; /* This will be filled if necessary in findlocale.c. */
newdata->filedata = (void *) filedata;
newdata->filesize = st.st_size;
- newdata->nstrings = W (filedata->nstrings);
+ newdata->nstrings = _nl_category_num_items[category];
for (cnt = 0; cnt < newdata->nstrings; ++cnt)
{
off_t idx = W (filedata->strindex[cnt]);
}
free ((void *) data);
}
-
-