summaryrefslogtreecommitdiff
path: root/lib/libc/gen/scandir.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/gen/scandir.c')
-rw-r--r--lib/libc/gen/scandir.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/gen/scandir.c b/lib/libc/gen/scandir.c
index 089ad19e0da..2ad8c3e612e 100644
--- a/lib/libc/gen/scandir.c
+++ b/lib/libc/gen/scandir.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scandir.c,v 1.11 2007/06/26 05:00:50 ray Exp $ */
+/* $OpenBSD: scandir.c,v 1.12 2007/09/02 15:19:16 deraadt Exp $ */
/*
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
@@ -78,7 +78,7 @@ scandir(const char *dirname, struct dirent ***namelist,
errno = ENOMEM;
goto fail;
}
- names = (struct dirent **)malloc(arraysz * sizeof(struct dirent *));
+ names = (struct dirent **)calloc(arraysz, sizeof(struct dirent *));
if (names == NULL)
goto fail;