From 8527dca81baa73fba64d6724bd498195ed1abbf2 Mon Sep 17 00:00:00 2001 From: Nick Kralevich Date: Thu, 15 Nov 2012 16:12:12 -0800 Subject: [PATCH] Get rid of strlcat / strlcpy Android already has a version of strlcat / strlcpy. There's no need for pppd to duplicate it. Change-Id: Ie094cccc2d2b8553cf3c6629c6a79bf3b8db9d06 --- pppd/pppd.h | 2 ++ pppd/utils.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/pppd/pppd.h b/pppd/pppd.h index 4c18d3d..9a86d99 100644 --- a/pppd/pppd.h +++ b/pppd/pppd.h @@ -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 */ diff --git a/pppd/utils.c b/pppd/utils.c index 1ef4b3b..6a743ea 100644 --- a/pppd/utils.c +++ b/pppd/utils.c @@ -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 /* -- 2.11.0