* lib/fts.c (fts_open): Prefer calloc to malloc + memset.
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.
}
/* 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;