MCPcopy Create free account
hub / github.com/F-Stack/f-stack / strncpy

Function strncpy

freebsd/libkern/strncpy.c:44–61  ·  view source on GitHub ↗

* Copy src to dst, truncating or null-padding to always copy n bytes. * Return dst. */

Source from the content-addressed store, hash-verified

42 * Return dst.
43 */
44char *
45strncpy(char * __restrict dst, const char * __restrict src, size_t n)
46{
47 if (n != 0) {
48 char *d = dst;
49 const char *s = src;
50
51 do {
52 if ((*d++ = *s++) == '\0') {
53 /* NUL pad the remaining n-1 bytes */
54 while (--n != 0)
55 *d++ = '\0';
56 break;
57 }
58 } while (--n != 0);
59 }
60 return (dst);
61}

Callers 15

if_indextonameFunction · 0.85
realhostnameFunction · 0.85
realhostname_saFunction · 0.85
NgSendAsciiMsgFunction · 0.85
NgDeliverMsgFunction · 0.85
NgRecvAsciiMsgFunction · 0.85
link_statusFunction · 0.85
routenameFunction · 0.85
netnameFunction · 0.85
xo_connect_logFunction · 0.85
nptv6_createFunction · 0.85
time_to_usFunction · 0.85

Calls

no outgoing calls

Tested by 8

draid_generateFunction · 0.68
draid_verifyFunction · 0.68
draid_dumpFunction · 0.68
draid_tableFunction · 0.68
draid_mergeFunction · 0.68
parse_argsFunction · 0.68
mainFunction · 0.68
do_linkFunction · 0.68