diff options
author | Jim Meyering <jim@meyering.net> | 2003-11-02 20:22:54 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2003-11-02 20:22:54 +0000 |
commit | 55760c106bdfc499174383849abd3e66841d7984 (patch) | |
tree | b42ee9d7d045cee89641f97224e6c271b86bd527 | |
parent | e5dda0ab935bc1c9b4bfa87db041bdb5de15b438 (diff) | |
download | coreutils-55760c106bdfc499174383849abd3e66841d7984.tar.xz |
(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.
-rw-r--r-- | src/df.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -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])) |