summaryrefslogtreecommitdiffstats
path: root/cat/virt-cat.c
diff options
context:
space:
mode:
Diffstat (limited to 'cat/virt-cat.c')
-rw-r--r--cat/virt-cat.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/cat/virt-cat.c b/cat/virt-cat.c
index 4d37ddab..775c7735 100644
--- a/cat/virt-cat.c
+++ b/cat/virt-cat.c
@@ -189,18 +189,17 @@ main (int argc, char *argv[])
while (optind < argc - 1) {
if (strchr (argv[optind], '/') ||
access (argv[optind], F_OK) == 0) { /* simulate -a option */
- drv = malloc (sizeof (struct drv));
+ drv = calloc (1, sizeof (struct drv));
if (!drv) {
perror ("malloc");
exit (EXIT_FAILURE);
}
drv->type = drv_a;
drv->a.filename = argv[optind];
- drv->a.format = NULL;
drv->next = drvs;
drvs = drv;
} else { /* simulate -d option */
- drv = malloc (sizeof (struct drv));
+ drv = calloc (1, sizeof (struct drv));
if (!drv) {
perror ("malloc");
exit (EXIT_FAILURE);