X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/d62bcc17f303f30d1e3df1051b1390202a21cf9c..4e1f385711a5c5703eb1c3bbf21cc83c95fe3a6e:/flist.c diff --git a/flist.c b/flist.c index 41acca35..6f20e83d 100644 --- a/flist.c +++ b/flist.c @@ -282,7 +282,7 @@ static int flist_dir_len; **/ void flist_expand(struct file_list *flist) { - void *new_ptr; + struct file_struct **new_ptr; 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->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", @@ -315,7 +311,7 @@ void flist_expand(struct file_list *flist) (new_ptr == flist->files) ? " not" : ""); } - flist->files = (struct file_struct **) new_ptr; + flist->files = new_ptr; if (!flist->files) out_of_memory("flist_expand"); @@ -332,7 +328,7 @@ void send_file_entry(struct file_struct *file, int f, unsigned short base_flags) static uid_t uid; static gid_t gid; static char lastname[MAXPATHLEN]; - char *fname, fbuf[MAXPATHLEN]; + char fname[MAXPATHLEN]; int l1, l2; if (f == -1) @@ -350,7 +346,7 @@ void send_file_entry(struct file_struct *file, int f, unsigned short base_flags) io_write_phase = "send_file_entry"; - fname = f_name_to(file, fbuf); + f_name_to(file, fname); flags = base_flags; @@ -953,7 +949,7 @@ void send_file_name(int f, struct file_list *flist, char *fname, rprintf(FINFO, "[%s] popping %sexclude list\n", who_am_i(), local_exclude_list.debug_type); } - free_exclude_list(&local_exclude_list); + clear_exclude_list(&local_exclude_list); local_exclude_list = last_list; } }