#undef strncpy
char *
-strncpy(char * dst, const char * src, size_t maxlen) {
- const size_t srclen = strnlen(src, maxlen);
- if (srclen < maxlen) {
- memcpy(dst, src, srclen);
- memset(dst+srclen, 0, maxlen - srclen);
- } else {
- memcpy(dst, src, maxlen);
- }
- return dst;
+strncpy(char * dst, const char * src, size_t maxlen)
+{
+ const size_t srclen = strnlen(src, maxlen);
+ if (srclen < maxlen) {
+ memcpy(dst, src, srclen);
+ memset(dst + srclen, 0, maxlen - srclen);
+ } else {
+ memcpy(dst, src, maxlen);
+ }
+ return dst;
}