mirror of
git://git.sv.gnu.org/coreutils.git
synced 2026-04-18 09:46:33 +02:00
Remove unnecessary casts of alloca, since now it's guaranteed to be (void *).
This commit is contained in:
9
src/cp.c
9
src/cp.c
@@ -285,7 +285,7 @@ re_protect (const char *const_dst_path, int src_offset,
|
||||
char *src_path; /* The source name in `dst_path'. */
|
||||
uid_t myeuid = geteuid ();
|
||||
|
||||
dst_path = (char *) alloca (strlen (const_dst_path) + 1);
|
||||
dst_path = alloca (strlen (const_dst_path) + 1);
|
||||
strcpy (dst_path, const_dst_path);
|
||||
src_path = dst_path + src_offset;
|
||||
|
||||
@@ -383,13 +383,13 @@ make_path_private (const char *const_dirpath, int src_offset, int mode,
|
||||
char *dst_dirname; /* Leading path of `dirpath'. */
|
||||
size_t dirlen; /* Length of leading path of `dirpath'. */
|
||||
|
||||
dirpath = (char *) alloca (strlen (const_dirpath) + 1);
|
||||
dirpath = alloca (strlen (const_dirpath) + 1);
|
||||
strcpy (dirpath, const_dirpath);
|
||||
|
||||
src = dirpath + src_offset;
|
||||
|
||||
dirlen = dir_len (dirpath);
|
||||
dst_dirname = (char *) alloca (dirlen + 1);
|
||||
dst_dirname = alloca (dirlen + 1);
|
||||
memcpy (dst_dirname, dirpath, dirlen);
|
||||
dst_dirname[dirlen] = '\0';
|
||||
|
||||
@@ -691,8 +691,7 @@ do_copy (int n_files, char **file, const char *target_directory,
|
||||
char *source_base;
|
||||
|
||||
ASSIGN_BASENAME_STRDUPA (source_base, source);
|
||||
new_dest = (char *) alloca (strlen (dest)
|
||||
+ strlen (source_base) + 1);
|
||||
new_dest = alloca (strlen (dest) + strlen (source_base) + 1);
|
||||
stpcpy (stpcpy (new_dest, dest), source_base);
|
||||
}
|
||||
else
|
||||
|
||||
6
src/ln.c
6
src/ln.c
@@ -75,12 +75,12 @@ int symlink ();
|
||||
char *tmp_source; \
|
||||
size_t buf_len = strlen (source) + 1; \
|
||||
\
|
||||
tmp_source = (char *) alloca (buf_len); \
|
||||
tmp_source = alloca (buf_len); \
|
||||
memcpy (tmp_source, (source), buf_len); \
|
||||
strip_trailing_slashes (tmp_source); \
|
||||
source_base = base_name (tmp_source); \
|
||||
\
|
||||
(new_dest) = (char *) alloca (strlen ((dest)) + 1 \
|
||||
(new_dest) = alloca (strlen ((dest)) + 1 \
|
||||
+ strlen (source_base) + 1); \
|
||||
stpcpy (stpcpy (stpcpy ((new_dest), (dest)), "/"), source_base);\
|
||||
} \
|
||||
@@ -266,7 +266,7 @@ do_link (const char *source, const char *dest)
|
||||
if (tmp_backup == NULL)
|
||||
xalloc_die ();
|
||||
buf_len = strlen (tmp_backup) + 1;
|
||||
dest_backup = (char *) alloca (buf_len);
|
||||
dest_backup = alloca (buf_len);
|
||||
memcpy (dest_backup, tmp_backup, buf_len);
|
||||
free (tmp_backup);
|
||||
if (rename (dest, dest_backup))
|
||||
|
||||
Reference in New Issue
Block a user