diff options
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/xfuncs.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libbb/xfuncs.c b/libbb/xfuncs.c index e2aee13..f3c3c53 100644 --- a/libbb/xfuncs.c +++ b/libbb/xfuncs.c @@ -40,6 +40,14 @@ int FAST_FUNC close_on_exec_on(int fd) return fcntl(fd, F_SETFD, FD_CLOEXEC); } +char* FAST_FUNC strncpy_IFNAMSIZ(char *dst, const char *src) +{ +#ifndef IFNAMSIZ + enum { IFNAMSIZ = 16 }; +#endif + return strncpy(dst, src, IFNAMSIZ); +} + /* Convert unsigned long long value into compact 4-char * representation. Examples: "1234", "1.2k", " 27M", "123T" * String is not terminated (buf[4] is untouched) */ |