diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-12-02 18:18:50 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-12-02 18:18:50 +0000 |
commit | 360d9661b6a33b0358104623058f1c3629a469ea (patch) | |
tree | 268954b686b38c96428e3b74fc1ebb2ebdfdfb32 /libbb | |
parent | 928b2c0fee65cae10f683ee0f1ea8d0a29a54924 (diff) | |
download | busybox-w32-360d9661b6a33b0358104623058f1c3629a469ea.tar.gz busybox-w32-360d9661b6a33b0358104623058f1c3629a469ea.tar.bz2 busybox-w32-360d9661b6a33b0358104623058f1c3629a469ea.zip |
libbb: add strncpy_IFNAMSIZ
function old new delta
...
udhcp_read_interface 225 220 -5
brctl_main 1151 1146 -5
add_interface 109 104 -5
ipaddr_list_or_flush 2174 2167 -7
do_add_ioctl 88 80 -8
vconfig_main 249 240 -9
do_del_ioctl 78 68 -10
do_iplink 1186 1173 -13
do_if_fetch 766 753 -13
buffer_fill_and_print 196 179 -17
parse_args 1709 1684 -25
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/20 up/down: 11/-140) Total: -129 bytes
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 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) */ |