Mercurial > hg > dhcpcd
changeset 85:5357d600e835 draft
Use libc strlcpy for uclibc and dietlibc
| author | Roy Marples <roy@marples.name> |
|---|---|
| date | Thu, 05 Apr 2007 18:05:38 +0000 |
| parents | bb98e91a2fea |
| children | 231c5353f0dd |
| files | common.c common.h |
| diffstat | 2 files changed, 5 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/common.c Thu Apr 05 17:38:18 2007 +0000 +++ b/common.c Thu Apr 05 18:05:38 2007 +0000 @@ -29,6 +29,7 @@ /* strlcpy is nice, shame glibc does not define it */ #ifdef __GLIBC__ +# if ! defined(__UCLIBC__) && ! defined (__dietlibc__) size_t strlcpy (char *dst, const char *src, size_t size) { const char *s = src; @@ -52,6 +53,7 @@ return (src - s - 1); } + #endif #endif /* This requires us to link to rt on glibc, so we use sysinfo instead */
--- a/common.h Thu Apr 05 17:38:18 2007 +0000 +++ b/common.h Thu Apr 05 18:05:38 2007 +0000 @@ -22,8 +22,11 @@ #ifndef COMMON_H #define COMMON_H +/* Only GLIBC doesn't support strlcpy */ #ifdef __GLIBC__ +# if ! defined(__UCLIBC__) && ! defined (__dietlibc__) size_t strlcpy (char *dst, const char *src, size_t size); +# endif #endif long uptime (void);
