summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Bonzini <bonzini@gnu.org>2011-07-05 11:32:02 +0200
committerPaolo Bonzini <bonzini@gnu.org>2012-01-03 10:39:53 +0100
commitf5e2cedf32554e6b4fd13a2d3ae410afd1065d88 (patch)
treecd676c349d9a3dff7bddf16bf525808ea429d5b9
parent74232e7b30467c32476efd2336207e6c5ee5aece (diff)
downloadgrep-f5e2cedf32554e6b4fd13a2d3ae410afd1065d88.tar.gz
dfa: use MALLOC/REALLOC always
src/dfa.c (dfastate, enlist, dfamust): Use MALLOC and REALLOC.
-rw-r--r--src/dfa.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/dfa.c b/src/dfa.c
index d2c24f7b..aa87f872 100644
--- a/src/dfa.c
+++ b/src/dfa.c
@@ -2367,8 +2367,8 @@ dfastate (int s, struct dfa *d, int trans[])
int next_isnt_1st_byte = 0; /* Flag if we can't add state0. */
int i, j, k;
- grps = xnmalloc (NOTCHAR, sizeof *grps);
- labels = xnmalloc (NOTCHAR, sizeof *labels);
+ MALLOC (grps, NOTCHAR);
+ MALLOC (labels, NOTCHAR);
/* Initialize the set of letters, if necessary. */
if (! initialized)
@@ -3659,7 +3659,7 @@ enlist (char **cpp, char *new, size_t len)
cpp[i] = NULL;
}
/* Add the new string. */
- cpp = xnrealloc(cpp, i + 2, sizeof *cpp);
+ REALLOC(cpp, i + 2);
cpp[i] = new;
cpp[i + 1] = NULL;
return cpp;
@@ -3792,7 +3792,7 @@ dfamust (struct dfa *d)
result = empty_string;
exact = 0;
- musts = xnmalloc(d->tindex + 1, sizeof *musts);
+ MALLOC (musts, d->tindex + 1);
mp = musts;
for (i = 0; i <= d->tindex; ++i)
mp[i] = must0;