diff options
Diffstat (limited to 'fish/fish.c')
-rw-r--r-- | fish/fish.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/fish/fish.c b/fish/fish.c index b782b7cb..3cf15b20 100644 --- a/fish/fish.c +++ b/fish/fish.c @@ -341,13 +341,12 @@ main (int argc, char *argv[]) list_prepared_drives (); exit (EXIT_SUCCESS); } - drv = malloc (sizeof (struct drv)); + drv = calloc (1, sizeof (struct drv)); if (!drv) { perror ("malloc"); exit (EXIT_FAILURE); } drv->type = drv_N; - drv->device = NULL; drv->nr_drives = -1; if (asprintf (&drv->N.filename, "test%d.img", next_prepared_drive++) == -1) { @@ -415,18 +414,17 @@ main (int argc, char *argv[]) while (optind < argc) { 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); |