Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
96981b9
)
Tweaked the alloc/realloc code in flist_expand().
author
Wayne Davison
<wayned@samba.org>
Fri, 21 May 2004 23:22:14 +0000
(23:22 +0000)
committer
Wayne Davison
<wayned@samba.org>
Fri, 21 May 2004 23:22:14 +0000
(23:22 +0000)
flist.c
patch
|
blob
|
blame
|
history
diff --git
a/flist.c
b/flist.c
index
9aa8850
..
4e6cf04
100644
(file)
--- a/
flist.c
+++ b/
flist.c
@@
-282,7
+282,7
@@
static int flist_dir_len;
**/
void flist_expand(struct file_list *flist)
{
**/
void flist_expand(struct file_list *flist)
{
-
void
*new_ptr;
+
struct file_struct *
*new_ptr;
if (flist->count < flist->malloced)
return;
if (flist->count < flist->malloced)
return;
@@
-301,12
+301,8
@@
void flist_expand(struct file_list *flist)
if (flist->malloced < flist->count)
flist->malloced = flist->count;
if (flist->malloced < flist->count)
flist->malloced = flist->count;
- if (flist->files) {
- new_ptr = realloc_array(flist->files,
- struct file_struct *, flist->malloced);
- } else {
- new_ptr = new_array(struct file_struct *, flist->malloced);
- }
+ new_ptr = realloc_array(flist->files, struct file_struct *,
+ flist->malloced);
if (verbose >= 2) {
rprintf(FINFO, "[%s] expand file_list to %.0f bytes, did%s move\n",
if (verbose >= 2) {
rprintf(FINFO, "[%s] expand file_list to %.0f bytes, did%s move\n",
@@
-315,7
+311,7
@@
void flist_expand(struct file_list *flist)
(new_ptr == flist->files) ? " not" : "");
}
(new_ptr == flist->files) ? " not" : "");
}
- flist->files =
(struct file_struct **)
new_ptr;
+ flist->files = new_ptr;
if (!flist->files)
out_of_memory("flist_expand");
if (!flist->files)
out_of_memory("flist_expand");