summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2003-11-02 20:22:54 +0000
committerJim Meyering <jim@meyering.net>2003-11-02 20:22:54 +0000
commit55760c106bdfc499174383849abd3e66841d7984 (patch)
treeb42ee9d7d045cee89641f97224e6c271b86bd527
parente5dda0ab935bc1c9b4bfa87db041bdb5de15b438 (diff)
downloadcoreutils-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.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/df.c b/src/df.c
index 85097a25e..14a83bc81 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]))