Use snprintf instead of strlcpy to save on size if not available.

This commit is contained in:
Roy Marples
2009-01-12 08:31:03 +00:00
parent a33554ab18
commit 8a9a2d5fe9
2 changed files with 7 additions and 24 deletions

View File

@@ -31,29 +31,6 @@
#include "librc.h"
#ifdef __GLIBC__
# if ! defined (__UCLIBC__) && ! defined (__dietlibc__)
static size_t strlcpy(char *dst, const char *src, size_t size)
{
const char *s = src;
size_t n = size;
if (n && --n)
do {
if (!(*dst++ = *src++))
break;
} while (--n);
if (!n) {
if (size)
*dst = '\0';
while (*src++);
}
return src - s - 1;
}
# endif
#endif
#if defined(__linux__)