diff options
Diffstat (limited to 'libbb/xfuncs.c')
-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 e2aee136c..f3c3c538c 100644 --- a/libbb/xfuncs.c +++ b/libbb/xfuncs.c | |||
@@ -40,6 +40,14 @@ int FAST_FUNC close_on_exec_on(int fd) | |||
40 | return fcntl(fd, F_SETFD, FD_CLOEXEC); | 40 | return fcntl(fd, F_SETFD, FD_CLOEXEC); |
41 | } | 41 | } |
42 | 42 | ||
43 | char* FAST_FUNC strncpy_IFNAMSIZ(char *dst, const char *src) | ||
44 | { | ||
45 | #ifndef IFNAMSIZ | ||
46 | enum { IFNAMSIZ = 16 }; | ||
47 | #endif | ||
48 | return strncpy(dst, src, IFNAMSIZ); | ||
49 | } | ||
50 | |||
43 | /* Convert unsigned long long value into compact 4-char | 51 | /* Convert unsigned long long value into compact 4-char |
44 | * representation. Examples: "1234", "1.2k", " 27M", "123T" | 52 | * representation. Examples: "1234", "1.2k", " 27M", "123T" |
45 | * String is not terminated (buf[4] is untouched) */ | 53 | * String is not terminated (buf[4] is untouched) */ |