X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fregcomp.c;h=28e677bb4a2e36861edb05bc89080c200607be81;hb=3af956aefeb791864e317142d848f6a58cf10f49;hp=6c8aea48a02d0f536293e05199f6f5c8340051db;hpb=083768e30add2d4c53372b98ae64092d1b97ee4b;p=gnulib.git diff --git a/lib/regcomp.c b/lib/regcomp.c index 6c8aea48a..28e677bb4 100644 --- a/lib/regcomp.c +++ b/lib/regcomp.c @@ -311,7 +311,8 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state, #ifdef RE_ENABLE_I18N if ((bufp->re_syntax & REG_IGNORE_CASE) && dfa->mb_cur_max > 1) { - unsigned char *buf = alloca (dfa->mb_cur_max), *p; + unsigned char buf[MB_LEN_MAX]; + unsigned char *p; wchar_t wc; mbstate_t state; @@ -817,7 +818,7 @@ init_dfa (re_dfa_t *dfa, int pat_len) if (table_size > pat_len) break; - dfa->state_table = calloc (sizeof (struct re_state_table_entry), table_size); + dfa->state_table = re_calloc (struct re_state_table_entry, table_size); dfa->state_hash_mask = table_size - 1; dfa->mb_cur_max = MB_CUR_MAX; @@ -860,7 +861,7 @@ init_dfa (re_dfa_t *dfa, int pat_len) { int i, j, ch; - dfa->sb_char = (re_bitset_ptr_t) calloc (sizeof (bitset), 1); + dfa->sb_char = re_calloc (unsigned int, BITSET_UINTS); if (BE (dfa->sb_char == NULL, 0)) return REG_ESPACE; @@ -2963,9 +2964,9 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, _NL_COLLATE_SYMB_EXTRAMB); } #endif - sbcset = (re_bitset_ptr_t) calloc (sizeof (unsigned int), BITSET_UINTS); + sbcset = re_calloc (unsigned int, BITSET_UINTS); #ifdef RE_ENABLE_I18N - mbcset = (re_charset_t *) calloc (sizeof (re_charset_t), 1); + mbcset = re_calloc (re_charset_t, 1); #endif /* RE_ENABLE_I18N */ #ifdef RE_ENABLE_I18N if (BE (sbcset == NULL || mbcset == NULL, 0)) @@ -3492,9 +3493,9 @@ build_charclass_op (re_dfa_t *dfa, unsigned REG_TRANSLATE_TYPE trans, re_token_t br_token; bin_tree_t *tree; - sbcset = (re_bitset_ptr_t) calloc (sizeof (unsigned int), BITSET_UINTS); + sbcset = re_calloc (unsigned int, BITSET_UINTS); #ifdef RE_ENABLE_I18N - mbcset = (re_charset_t *) calloc (sizeof (re_charset_t), 1); + mbcset = re_calloc (re_charset_t, 1); #endif /* RE_ENABLE_I18N */ #ifdef RE_ENABLE_I18N