strlcpy() to forcibly truncate a string to a known length, when
memcpy() and a write of '\0' will not only make the intent clear, but
also do that exact job more efficiently.
p4raw-id: //depot/perl@32125
bsiz = l + 1; /* + 1 for the \0. */
buf = (char*)safesysmalloc(bufsiz);
}
- my_strlcpy(buf, *environ, l + 1);
+ memcpy(buf, *environ, l);
+ buf[l] = '\0';
(void)unsetenv(buf);
}
(void)safesysfree(buf);