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
d9c0051f
Commit
d9c0051f
authored
Mar 31, 2005
by
Wayne Davison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
In log_formatted(), add the newline to the format string so
that we can call rwrite() instead of rprintf().
parent
126e7aff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
log.c
log.c
+8
-2
No files found.
log.c
View file @
d9c0051f
...
...
@@ -363,6 +363,12 @@ static void log_formatted(enum logcode code, char *format, char *op,
* copy in the terminating null of the inserted strings, but
* rather keep going until we reach the null of the format. */
total
=
strlcpy
(
buf
,
format
,
sizeof
buf
);
if
(
total
>
MAXPATHLEN
)
{
rprintf
(
FERROR
,
"log-format string is WAY too long!
\n
"
);
exit_cleanup
(
RERR_MESSAGEIO
);
}
buf
[
total
++
]
=
'\n'
;
buf
[
total
]
=
'\0'
;
for
(
p
=
buf
;
(
p
=
strchr
(
p
,
'%'
))
!=
NULL
;
)
{
s
=
p
++
;
...
...
@@ -517,7 +523,7 @@ static void log_formatted(enum logcode code, char *format, char *op,
/* Subtract the length of the escape from the string's size. */
total
-=
p
-
s
;
if
(
len
+
total
>=
sizeof
buf
)
{
if
(
len
+
total
>=
(
size_t
)
sizeof
buf
)
{
rprintf
(
FERROR
,
"buffer overflow expanding %%%c -- exiting
\n
"
,
p
[
-
1
]);
...
...
@@ -537,7 +543,7 @@ static void log_formatted(enum logcode code, char *format, char *op,
p
=
s
+
len
;
}
r
printf
(
code
,
"%s
\n
"
,
buf
);
r
write
(
code
,
buf
,
total
);
}
int
log_format_has
(
const
char
*
format
,
char
esc
)
...
...
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