From 55760c106bdfc499174383849abd3e66841d7984 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sun, 2 Nov 2003 20:22:54 +0000 Subject: [PATCH] (add_fs_type, add_excluded_fs_type, main): Use `sizeof *var' rather than `sizeof EXPLICIT_TYPE'. The former is more maintainable and usually shorter. (main): Also remove anachronistic cast of xmalloc return value. --- src/df.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/df.c b/src/df.c index 85097a25eb..14a83bc812 100644 --- a/src/df.c +++ b/src/df.c @@ -697,7 +697,7 @@ add_fs_type (const char *fstype) { struct fs_type_list *fsp; - fsp = xmalloc (sizeof (struct fs_type_list)); + fsp = xmalloc (sizeof *fsp); fsp->fs_name = (char *) fstype; fsp->fs_next = fs_select_list; fs_select_list = fsp; @@ -710,7 +710,7 @@ add_excluded_fs_type (const char *fstype) { struct fs_type_list *fsp; - fsp = xmalloc (sizeof (struct fs_type_list)); + fsp = xmalloc (sizeof *fsp); fsp->fs_name = (char *) fstype; fsp->fs_next = fs_exclude_list; fs_exclude_list = fsp; @@ -890,8 +890,7 @@ main (int argc, char **argv) /* stat all the given entries to make sure they get automounted, if necessary, before reading the filesystem table. */ - stats = (struct stat *) - xmalloc ((argc - optind) * sizeof (struct stat)); + stats = xmalloc ((argc - optind) * sizeof *stats); for (i = optind; i < argc; ++i) { if (stat (argv[i], &stats[i - optind])) -- 2.47.2