commit 9a4fba02519efc4382fd605ec144ace2fd461798
parent 471432a9e69cfa6df095089838f779b73e916ed4
Author: sin <sin@2f30.org>
Date: Mon, 10 Feb 2014 19:28:39 +0000
Use calloc() instead of malloc() + memset()
Diffstat:
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/insmod.c b/insmod.c
@@ -51,10 +51,9 @@ main(int argc, char *argv[])
plen += strlen(argv[i]);
if (plen > 0) {
plen += argc;
- opts = malloc(plen);
+ opts = calloc(1, plen);
if (!opts)
eprintf("malloc:");
- memset(opts, 0, plen);
for (i = 0; i < argc; i++) {
strcat(opts, argv[i]);
if (i + 1 < argc)