projects
/
platform
/
upstream
/
coreutils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4265d00
)
(make_path_private): Use `sizeof *var' rather than `sizeof EXPLICIT_TYPE'.
author
Jim Meyering
<jim@meyering.net>
Sun, 2 Nov 2003 20:17:46 +0000
(20:17 +0000)
committer
Jim Meyering
<jim@meyering.net>
Sun, 2 Nov 2003 20:17:46 +0000
(20:17 +0000)
The former is more maintainable and usually shorter.
src/cp.c
patch
|
blob
|
history
diff --git
a/src/cp.c
b/src/cp.c
index
05c4bc2
..
e92d819
100644
(file)
--- a/
src/cp.c
+++ b/
src/cp.c
@@
-408,8
+408,7
@@
make_path_private (const char *const_dirpath, int src_offset, int mode,
{
/* Add this directory to the list of directories whose modes need
fixing later. */
- struct dir_attr *new =
- xmalloc (sizeof (struct dir_attr));
+ struct dir_attr *new = xmalloc (sizeof *new);
new->slash_offset = slash - dirpath;
new->next = *attr_list;
*attr_list = new;