Module Name: src
Committed By: pgoyette
Date: Tue May 31 07:49:10 UTC 2016
Modified Files:
src/lib/libc/gen: fts.c
Log Message:
Use calloc(1, ...) instead of malloc(...) followed immediately by memset()
Addresses PR lib/46818
To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/lib/libc/gen/fts.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libc/gen/fts.c
diff -u src/lib/libc/gen/fts.c:1.48 src/lib/libc/gen/fts.c:1.49
--- src/lib/libc/gen/fts.c:1.48 Thu Jan 29 15:55:21 2015
+++ src/lib/libc/gen/fts.c Tue May 31 07:49:09 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: fts.c,v 1.48 2015/01/29 15:55:21 manu Exp $ */
+/* $NetBSD: fts.c,v 1.49 2016/05/31 07:49:09 pgoyette Exp $ */
/*-
* Copyright (c) 1990, 1993, 1994
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94";
#else
-__RCSID("$NetBSD: fts.c,v 1.48 2015/01/29 15:55:21 manu Exp $");
+__RCSID("$NetBSD: fts.c,v 1.49 2016/05/31 07:49:09 pgoyette Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -133,9 +133,8 @@ fts_open(char * const *argv, int options
}
/* Allocate/initialize the stream */
- if ((sp = malloc(sizeof(FTS))) == NULL)
+ if ((sp = calloc(1, sizeof(FTS))) == NULL)
return (NULL);
- memset(sp, 0, sizeof(FTS));
sp->fts_compar = compar;
sp->fts_options = options;