Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
halo
external_ppp
Commits
fc562d20
Commit
fc562d20
authored
12 years ago
by
Ben Cheng
Committed by
Gerrit Code Review
12 years ago
Browse files
Options
Download
Plain Diff
Merge "Get rid of strlcat / strlcpy"
parents
e644c9d2
d415ebef
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
0 deletions
+5
-0
pppd/pppd.h
pppd/pppd.h
+2
-0
pppd/utils.c
pppd/utils.c
+3
-0
No files found.
pppd/pppd.h
View file @
fc562d20
...
...
@@ -506,8 +506,10 @@ void print_string __P((char *, int, void (*) (void *, char *, ...),
void
*
));
/* Format a string for output */
int
slprintf
__P
((
char
*
,
int
,
char
*
,
...));
/* sprintf++ */
int
vslprintf
__P
((
char
*
,
int
,
char
*
,
va_list
));
/* vsprintf++ */
#if !defined(ANDROID_CHANGES)
size_t
strlcpy
__P
((
char
*
,
const
char
*
,
size_t
));
/* safe strcpy */
size_t
strlcat
__P
((
char
*
,
const
char
*
,
size_t
));
/* safe strncpy */
#endif
void
dbglog
__P
((
char
*
,
...));
/* log a debug message */
void
info
__P
((
char
*
,
...));
/* log an informational message */
void
notice
__P
((
char
*
,
...));
/* log a notice-level message */
...
...
This diff is collapsed.
Click to expand it.
pppd/utils.c
View file @
fc562d20
...
...
@@ -81,6 +81,8 @@ struct buffer_info {
int
len
;
};
#if !defined(ANDROID_CHANGES)
/*
* strlcpy - like strcpy/strncpy, doesn't overflow destination buffer,
* always leaves destination null-terminated (for len > 0).
...
...
@@ -118,6 +120,7 @@ strlcat(dest, src, len)
return
dlen
+
strlcpy
(
dest
+
dlen
,
src
,
(
len
>
dlen
?
len
-
dlen
:
0
));
}
#endif
/*
...
...
This diff is collapsed.
Click to expand it.
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