blob: 6ce46e3d3e970d63c76569c282c0f17414a3dac0 (
plain) (
tree)
|
|
#include <stddef.h>
#include <string.h>
size_t strlcpy(char *dst, const char *src, size_t size)
{
size_t ret = strlen(src), len;
if (!size) return ret;
len = ret;
if (len >= size) len = size - 1;
memcpy(dst, src, len);
dst[len] = 0;
return ret;
}
|