projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Replace mh_xmalloc() with mh_xcalloc()
[mmh]
/
sbr
/
crawl_folders.c
diff --git
a/sbr/crawl_folders.c
b/sbr/crawl_folders.c
index
47327ed
..
2e1a094
100644
(file)
--- a/
sbr/crawl_folders.c
+++ b/
sbr/crawl_folders.c
@@
-142,10
+142,10
@@
crawl_folders_body(struct crawl_context *crawl, char *dir,
void
crawl_folders(char *dir, crawl_callback_t *callback, void *baton)
{
void
crawl_folders(char *dir, crawl_callback_t *callback, void *baton)
{
- struct crawl_context *crawl = mh_xmalloc(sizeof(*crawl));
+ struct crawl_context *crawl = mh_xcalloc(1, sizeof(*crawl));
crawl->max = CRAWL_NUMFOLDERS;
crawl->total = crawl->start = crawl->foldp = 0;
crawl->max = CRAWL_NUMFOLDERS;
crawl->total = crawl->start = crawl->foldp = 0;
- crawl->folders = mh_xmalloc(crawl->max * sizeof(*crawl->folders));
+ crawl->folders = mh_xcalloc(crawl->max, sizeof(*crawl->folders));
crawl_folders_body(crawl, dir, callback, baton);
crawl_folders_body(crawl, dir, callback, baton);