Commit 56d8bdcb authored by Paul Eggert's avatar Paul Eggert
Browse files

fts: tune via calloc

* lib/fts.c (fts_open): Prefer calloc to malloc + memset.
parent d19dc900
2019-12-17 Paul Eggert <eggert@cs.ucla.edu>
 
fts: tune via calloc
* lib/fts.c (fts_open): Prefer calloc to malloc + memset.
dfa: tune via xzalloc
* lib/dfa.c (dfaoptimize): Prefer xzalloc to xmalloc + memset.
 
......@@ -381,9 +381,9 @@ fts_open (char * const *argv,
}
/* Allocate/initialize the stream */
if ((sp = malloc(sizeof(FTS))) == NULL)
sp = calloc (1, sizeof *sp);
if (sp == NULL)
return (NULL);
memset(sp, 0, sizeof(FTS));
sp->fts_compar = compar;
sp->fts_options = options;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment