Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liblongpath-rsync
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liblongpath
liblongpath-rsync
Commits
7e4b6b7b
Commit
7e4b6b7b
authored
Sep 03, 2007
by
Wayne Davison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use new0() function instead of new() followed by memset().
parent
a2dc4d68
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
7 deletions
+15
-7
exclude.c
exclude.c
+1
-2
fileio.c
fileio.c
+1
-2
flist.c
flist.c
+13
-3
No files found.
exclude.c
View file @
7e4b6b7b
...
...
@@ -144,9 +144,8 @@ static void add_rule(struct filter_list_struct *listp, const char *pat,
}
}
if
(
!
(
ret
=
new
(
struct
filter_struct
)))
if
(
!
(
ret
=
new
0
(
struct
filter_struct
)))
out_of_memory
(
"add_rule"
);
memset
(
ret
,
0
,
sizeof
ret
[
0
]);
if
(
!
(
mflags
&
(
MATCHFLG_ABS_PATH
|
MATCHFLG_MERGE_FILE
))
&&
((
xflags
&
(
XFLG_ANCHORED2ABS
|
XFLG_ABS_IF_SLASH
)
&&
*
pat
==
'/'
)
...
...
fileio.c
View file @
7e4b6b7b
...
...
@@ -159,13 +159,12 @@ struct map_struct *map_file(int fd, OFF_T len, int32 read_size,
{
struct
map_struct
*
map
;
if
(
!
(
map
=
new
(
struct
map_struct
)))
if
(
!
(
map
=
new
0
(
struct
map_struct
)))
out_of_memory
(
"map_file"
);
if
(
blk_size
&&
(
read_size
%
blk_size
))
read_size
+=
blk_size
-
(
read_size
%
blk_size
);
memset
(
map
,
0
,
sizeof
map
[
0
]);
map
->
fd
=
fd
;
map
->
file_size
=
len
;
map
->
def_window_size
=
read_size
;
...
...
flist.c
View file @
7e4b6b7b
...
...
@@ -89,6 +89,18 @@ int flist_cnt = 0; /* how many (non-tmp) file list objects exist */
int
file_total
=
0
;
/* total of all active items over all file-lists */
int
flist_eof
=
0
;
/* all the file-lists are now known */
/* Starting from protocol version 26, we always use 64-bit ino_t and dev_t
* internally, even if this platform does not allow files to have 64-bit inums.
* The only exception is if we're on a platform with no 64-bit type at all.
*
* Because we use read_longint() to get these off the wire, if you transfer
* devices or (for protocols < 30) hardlinks with dev or inum > 2**32 to a
* machine with no 64-bit types then you will get an overflow error.
*
* Note that if you transfer devices from a 64-bit-devt machine (say, Solaris)
* to a 32-bit-devt machine (say, Linux-2.2/x86) then the device numbers will
* be truncated. But it's a kind of silly thing to do anyhow. */
/* The tmp_* vars are used as a cache area by make_file() to store data
* that the sender doesn't need to remember in its file list. The data
* will survive just long enough to be used by send_file_entry(). */
...
...
@@ -2164,12 +2176,10 @@ struct file_list *flist_new(int flags, char *msg)
{
struct
file_list
*
flist
;
flist
=
new
(
struct
file_list
);
flist
=
new
0
(
struct
file_list
);
if
(
!
flist
)
out_of_memory
(
msg
);
memset
(
flist
,
0
,
sizeof
flist
[
0
]);
if
(
flags
&
FLIST_TEMP
)
{
if
(
!
(
flist
->
file_pool
=
pool_create
(
SMALL_EXTENT
,
0
,
out_of_memory
,
POOL_INTERN
)))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment