diff options
Diffstat (limited to 'locale')
-rw-r--r-- | locale/locale-ctype.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/locale/locale-ctype.c b/locale/locale-ctype.c index 1ce09bab2b..e7a1e97960 100644 --- a/locale/locale-ctype.c +++ b/locale/locale-ctype.c @@ -534,16 +534,20 @@ allocate_arrays (void) char *ptr; int size = charmap_data.hash_size * charmap_data.hash_layers; - ctype_b = (u16 *) xcalloc (size - (-128), sizeof (u16)); + ctype_b = xmalloc ((size - (-128)) * sizeof (u16)); + bzero (ctype_b, (size - (-128)) * sizeof (u16)); ctype_b += 128; - names_b = (i32 *) xcalloc (size, sizeof (i32)); + names_b = xmalloc (size * sizeof (i32)); + bzero (names_b, size * sizeof (i32)); - toupper_b = (i32 *) xcalloc ((size - (-128)), sizeof (i32)); + toupper_b = xmalloc ((size - (-128)) * sizeof (i32)); + bzero (toupper_b, (size - (-128)) * sizeof (i32)); toupper_b += 128; - tolower_b = (i32 *) xcalloc ((size - (-128)), sizeof (i32)); + tolower_b = xmalloc ((size - (-128)) * sizeof (i32)); + bzero (tolower_b, (size - (-128)) * sizeof (i32)); tolower_b += 128; ptr = NULL; |