Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Batch-mode fix.
[rsync/rsync.git]
/
batch.c
diff --git
a/batch.c
b/batch.c
index
8c78ab6
..
d503373
100644
(file)
--- a/
batch.c
+++ b/
batch.c
@@
-185,15
+185,14
@@
struct file_list *create_flist_from_batch(void)
fdb_open = 1;
fdb_close = 0;
fdb_open = 1;
fdb_close = 0;
- batch_flist =
(struct file_list *) malloc(sizeof(batch_flist[0])
);
+ batch_flist =
new(struct file_list
);
if (!batch_flist) {
out_of_memory("create_flist_from_batch");
}
batch_flist->count = 0;
batch_flist->malloced = 1000;
if (!batch_flist) {
out_of_memory("create_flist_from_batch");
}
batch_flist->count = 0;
batch_flist->malloced = 1000;
- batch_flist->files =
- (struct file_struct **) malloc(sizeof(batch_flist->files[0]) *
- batch_flist->malloced);
+ batch_flist->files = new_array(struct file_struct *,
+ batch_flist->malloced);
if (!batch_flist->files) {
out_of_memory("create_flist_from_batch");
}
if (!batch_flist->files) {
out_of_memory("create_flist_from_batch");
}
@@
-207,14
+206,10
@@
struct file_list *create_flist_from_batch(void)
batch_flist->malloced += 1000;
else
batch_flist->malloced *= 2;
batch_flist->malloced += 1000;
else
batch_flist->malloced *= 2;
- batch_flist->files =
- (struct file_struct **) realloc(batch_flist->
- files,
- sizeof
- (batch_flist->
- files[0]) *
- batch_flist->
- malloced);
+ batch_flist->files
+ = realloc_array(batch_flist->files,
+ struct file_struct *,
+ batch_flist->malloced);
if (!batch_flist->files)
out_of_memory("create_flist_from_batch");
}
if (!batch_flist->files)
out_of_memory("create_flist_from_batch");
}
@@
-264,7
+259,7
@@
int read_batch_flist_file(char *buff, int len)
return bytes_read;
}
return bytes_read;
}
-unsigned char read_batch_flags()
+unsigned char read_batch_flags(
void
)
{
int flags;
{
int flags;
@@
-282,7
+277,7
@@
void read_batch_flist_info(struct file_struct **fptr)
char buff[256];
struct file_struct *file;
char buff[256];
struct file_struct *file;
- file =
(struct file_struct *) malloc(sizeof(*file)
);
+ file =
new(struct file_struct
);
if (!file)
out_of_memory("read_batch_flist_info");
memset((char *) file, 0, sizeof(*file));
if (!file)
out_of_memory("read_batch_flist_info");
memset((char *) file, 0, sizeof(*file));