13 lines
143 B
C
13 lines
143 B
C
|
#include <string.h>
|
||
|
|
||
|
char *
|
||
|
strlcpy(char *dest, char *src, size_t n)
|
||
|
{
|
||
|
char *p;
|
||
|
|
||
|
p = strncpy(dest, src, n);
|
||
|
dest[n-1] = '\0';
|
||
|
|
||
|
return p;
|
||
|
}
|